srikarxyz/nl2bash_v1
Viewer โข Updated โข 321k โข 32
How to use srikarxyz/howto-nl2bash_v1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="srikarxyz/howto-nl2bash_v1") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("srikarxyz/howto-nl2bash_v1")
model = AutoModelForCausalLM.from_pretrained("srikarxyz/howto-nl2bash_v1", device_map="auto")How to use srikarxyz/howto-nl2bash_v1 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "srikarxyz/howto-nl2bash_v1"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "srikarxyz/howto-nl2bash_v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/srikarxyz/howto-nl2bash_v1
How to use srikarxyz/howto-nl2bash_v1 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "srikarxyz/howto-nl2bash_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": "srikarxyz/howto-nl2bash_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 "srikarxyz/howto-nl2bash_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": "srikarxyz/howto-nl2bash_v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use srikarxyz/howto-nl2bash_v1 with Docker Model Runner:
docker model run hf.co/srikarxyz/howto-nl2bash_v1
howto-nl2bash_v1 is a 3B-parameter language model fine-tuned from SmolLM3-3B-Base with LoRA SFT (merged into the base weights).
from transformers import pipeline
generator = pipeline("text-generation", model="srikarxyz/howto-nl2bash_v1", device_map="auto")
print(generator("How do I ...", max_new_tokens=256, return_full_text=False)[0]["generated_text"])
| Base model | SmolLM3-3B-Base |
| Method | SFT, LoRA (r=256, alpha=256, all-linear), completion-only loss |
| Epochs | 2 |
| Learning rate | 1e-4 |
| Batch size | 2 x 8 grad. accumulation |
| Max length | 1024 (packing) |
| Precision | bf16 |
| Final train loss | 0.179 |
Frameworks: TRL 0.23.1, Transformers 5.5.4, PyTorch 2.11.0, Datasets 4.3.0, Tokenizers 0.22.2.
A small model; outputs may be inaccurate. Verify anything important.
Base model
HuggingFaceTB/SmolLM3-3B-Base