Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
English
German
t5
text2text-generation
text-generation-inference
Instructions to use oliverguhr/spelling-correction-multilingual-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use oliverguhr/spelling-correction-multilingual-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="oliverguhr/spelling-correction-multilingual-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("oliverguhr/spelling-correction-multilingual-base") model = AutoModelForSeq2SeqLM.from_pretrained("oliverguhr/spelling-correction-multilingual-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use oliverguhr/spelling-correction-multilingual-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "oliverguhr/spelling-correction-multilingual-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oliverguhr/spelling-correction-multilingual-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/oliverguhr/spelling-correction-multilingual-base
- SGLang
How to use oliverguhr/spelling-correction-multilingual-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "oliverguhr/spelling-correction-multilingual-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oliverguhr/spelling-correction-multilingual-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "oliverguhr/spelling-correction-multilingual-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oliverguhr/spelling-correction-multilingual-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use oliverguhr/spelling-correction-multilingual-base with Docker Model Runner:
docker model run hf.co/oliverguhr/spelling-correction-multilingual-base
|
Download README.md from oliverguhr/spelling-correction-multilingual-base: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/oliverguhr/spelling-correction-multilingual-base/resolve/refs%2Fpr%2F2/README.md
- Command line
-
hf download hf://oliverguhr/spelling-correction-multilingual-base@refs/pr/2/README.md
-
curl -L -o README.md https://huggingface.co/oliverguhr/spelling-correction-multilingual-base/resolve/refs%2Fpr%2F2/README.md
1.37 kB
metadata
language:
- en
- de
license: mit
widget:
- text: fix:lets do a comparsion
example_title: EN 1
- text: fix:Their going to be here so0n
example_title: EN 2
- text: fix:das idst ein neuZr test
example_title: DE 1
- text: >-
fix:ein dransformer isd ein mthode mit der ein compuder eine volge von
zeichn übersetz
example_title: DE 2
- text: fix:can we mix the languages können wir die sprachen mischen
example_title: EN and DE
metrics:
- cer
pipeline_tag: text2text-generation
This is an experimental model that should fix your typos and punctuation. If you like to run your own experiments or train for a different language, take a look at the code.
Model description
This is a proof of concept spelling correction model for English and German.
Intended uses & limitations
This project is work in progress, be aware that the model can produce artefacts. You can test the model using the pipeline-interface:
from transformers import pipeline
fix_spelling_pipeline = pipeline("text2text-generation",model="oliverguhr/spelling-correction-multilingual-base")
def fix_spelling(text, max_length = 256):
return fix_spelling_pipeline("fix:"+text,max_length = max_length)
print(fix_spelling_pipeline("can we mix the languages können wir die sprachen mischen",max_length=2048))