soketlabs/bhasha-wiki-indic-context
Viewer • Updated • 101k • 128 • 1
How to use Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1", dtype="auto")How to use Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1 with PEFT:
Task type is invalid.
How to use Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1
How to use Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1" \
--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": "Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1" \
--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": "Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1 with Docker Model Runner:
docker model run hf.co/Neural-Hacker/Mistral-7b-Indic-Chat-LoRA-v1
Lightweight multilingual conversational LoRA adapter built on Mistral-7B
This model enables English ↔ Hindi translation, Hinglish conversational Q/A, and basic chat-style responses. It is focused on language alignment rather than deep reasoning.
Base: mistralai/Mistral-7B-v0.1
Method: LoRA (PEFT)
User:
Assistant:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
model_name = "mistralai/Mistral-7B-v0.1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(model_name)
model = PeftModel.from_pretrained(base_model, "YOUR_MODEL_PATH")
model.eval()
prompt = "User: gravity kya hoti hai?\nAssistant:"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=50,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.2,
eos_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split("Assistant:")[-1].strip())
This model is released under the CC BY-NC 4.0 license.
Base model
mistralai/Mistral-7B-v0.1