Instructions to use rudrashah/RLM-spell-checker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rudrashah/RLM-spell-checker with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rudrashah/RLM-spell-checker")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rudrashah/RLM-spell-checker") model = AutoModelForCausalLM.from_pretrained("rudrashah/RLM-spell-checker") - Keras
How to use rudrashah/RLM-spell-checker with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://rudrashah/RLM-spell-checker") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use rudrashah/RLM-spell-checker with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rudrashah/RLM-spell-checker" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rudrashah/RLM-spell-checker", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rudrashah/RLM-spell-checker
- SGLang
How to use rudrashah/RLM-spell-checker 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 "rudrashah/RLM-spell-checker" \ --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": "rudrashah/RLM-spell-checker", "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 "rudrashah/RLM-spell-checker" \ --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": "rudrashah/RLM-spell-checker", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rudrashah/RLM-spell-checker with Docker Model Runner:
docker model run hf.co/rudrashah/RLM-spell-checker
Description
The RLM-spell-checker is a fine-tuned version of gemma-2b-V3, enhanced using LoRA (Low-Rank Adaptation) to specialize in spelling correction. LoRA fine-tunes models efficiently by adjusting only a few parameters, allowing the RLM-spell-checker to retain the robust language understanding of gemma-2b-V3 while focusing on identifying and correcting spelling errors. This fine-tuning enables the model to provide context-aware suggestions for corrections, making it a powerful tool for real-time applications like automated writing assistance, chatbots, and word processors. By improving spelling accuracy without interrupting the natural flow of text, the RLM-spell-checker enhances text quality and user experience in various tasks.
Author: Rudra Shah
Running Model
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("rudrashah/RLM-spell-checker")
model = AutoModelForCausalLM.from_pretrained("rudrashah/RLM-spell-checker")
sent = "Whaat iss the mision?"
template = "Sentence:\n{org}\n\nCorrect_Grammar:\n{new}"
input_text = template.format(org=sent, new="")
input_ids = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**input_ids, max_new_tokens=128)
print(tokenizer.decode(outputs[0]))
- Downloads last month
- 9