wikimedia/wikipedia
Viewer • Updated • 61.6M • 289k • 1.69k
How to use logicwahid/Kotha-S1-Instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="logicwahid/Kotha-S1-Instruct") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("logicwahid/Kotha-S1-Instruct")
model = AutoModelForCausalLM.from_pretrained("logicwahid/Kotha-S1-Instruct", device_map="auto")How to use logicwahid/Kotha-S1-Instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "logicwahid/Kotha-S1-Instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "logicwahid/Kotha-S1-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/logicwahid/Kotha-S1-Instruct
How to use logicwahid/Kotha-S1-Instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "logicwahid/Kotha-S1-Instruct" \
--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": "logicwahid/Kotha-S1-Instruct",
"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 "logicwahid/Kotha-S1-Instruct" \
--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": "logicwahid/Kotha-S1-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use logicwahid/Kotha-S1-Instruct with Docker Model Runner:
docker model run hf.co/logicwahid/Kotha-S1-Instruct
Md. Wahid · Kotha Lab
Kotha-S1-Instruct is a 99.9M parameter bilingual (Bengali and English) instruction-tuned language model based on logicwahid/Kotha-S1. Built on a LLaMA-style architecture, it is designed to run on standard CPUs, edge devices, and low-resource environments.
[INST] prompt [/INST]import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.float16 if torch.cuda.is_available() else torch.float32
repo_id = "logicwahid/Kotha-S1-Instruct"
tok = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id, torch_dtype=dtype).to(device)
prompt = "[INST] বাংলাদেশের রাজধানী কী? [/INST] "
inputs = tok(prompt, return_tensors="pt").to(device)
out = model.generate(
**inputs,
max_new_tokens=80,
do_sample=True,
top_p=0.85,
temperature=0.3,
repetition_penalty=1.15
)
print(tok.decode(out[0], skip_special_tokens=True))