HuggingFaceFW/fineweb-edu
Viewer • Updated • 3.5B • 437k • 1.39k
How to use logicwahid/Kotha-S1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="logicwahid/Kotha-S1") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("logicwahid/Kotha-S1")
model = AutoModelForCausalLM.from_pretrained("logicwahid/Kotha-S1", device_map="auto")How to use logicwahid/Kotha-S1 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "logicwahid/Kotha-S1"
# 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",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/logicwahid/Kotha-S1
How to use logicwahid/Kotha-S1 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "logicwahid/Kotha-S1" \
--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",
"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" \
--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",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use logicwahid/Kotha-S1 with Docker Model Runner:
docker model run hf.co/logicwahid/Kotha-S1
Md. Wahid · Kotha Lab
Kotha-S1 is a 99.9M parameter bilingual (Bengali and English) base language model trained from scratch on a custom LLaMA-style architecture. It serves as the foundation for logicwahid/Kotha-S1-Instruct and is designed for research, custom fine-tuning, and deployment on edge devices or standard CPUs.
As a pretrained base model, Kotha-S1 completes text continuations rather than following chat instructions directly. For chat or question-answering, use Kotha-S1-Instruct.
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"
tok = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id, torch_dtype=dtype).to(device)
prompt = "বাংলাদেশের রাজধানী ঢাকা একটি "
inputs = tok(prompt, return_tensors="pt").to(device)
out = model.generate(
**inputs,
max_new_tokens=60,
do_sample=True,
top_p=0.85,
temperature=0.4,
repetition_penalty=1.15
)
print(tok.decode(out[0], skip_special_tokens=True))