Text Generation
Transformers
Safetensors
Romanian
English
rost
romanian
bilingual
nanochat
conversational
custom_code
Instructions to use rostlabs/rost-1b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rostlabs/rost-1b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rostlabs/rost-1b-base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("rostlabs/rost-1b-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rostlabs/rost-1b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rostlabs/rost-1b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rostlabs/rost-1b-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rostlabs/rost-1b-base
- SGLang
How to use rostlabs/rost-1b-base 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 "rostlabs/rost-1b-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rostlabs/rost-1b-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "rostlabs/rost-1b-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rostlabs/rost-1b-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rostlabs/rost-1b-base with Docker Model Runner:
docker model run hf.co/rostlabs/rost-1b-base
The weights are bfloat16 now; say so instead of explaining float32
Browse files
README.md
CHANGED
|
@@ -51,10 +51,13 @@ out = model.generate(inputs["input_ids"].to("cuda"), max_new_tokens=128)
|
|
| 51 |
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
| 52 |
```
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
Measured on a single RTX 5070 (12 GB, SDPA path): **~91 tokens/second**, ~3.3 GB
|
| 60 |
resident.
|
|
|
|
| 51 |
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
| 52 |
```
|
| 53 |
|
| 54 |
+
The weights are stored in bfloat16, the precision the model was trained in and the
|
| 55 |
+
precision the forward pass casts to regardless. They were published as float32 at first,
|
| 56 |
+
because release verification compares logits exactly and that is only meaningful in float32 —
|
| 57 |
+
but that made the files twice the size for no information: 47% of the parameters were already
|
| 58 |
+
bfloat16-exact, and under bfloat16 the two files produce bitwise identical logits. Loading in
|
| 59 |
+
float32 is still possible and shifts the top-8 probabilities by up to 1.7e-03, a mode the
|
| 60 |
+
model was never trained in.
|
| 61 |
|
| 62 |
Measured on a single RTX 5070 (12 GB, SDPA path): **~91 tokens/second**, ~3.3 GB
|
| 63 |
resident.
|