Text Generation
Transformers
Safetensors
English
pragya_e2
small-language-model
from-scratch
causal-lm
decoder-only
gqa
rope
swiglu
exclusive-gated-attention
engram
kv-cache
custom_code
Instructions to use RuVI-AI/Pragya-EXP2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RuVI-AI/Pragya-EXP2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RuVI-AI/Pragya-EXP2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("RuVI-AI/Pragya-EXP2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RuVI-AI/Pragya-EXP2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RuVI-AI/Pragya-EXP2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RuVI-AI/Pragya-EXP2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RuVI-AI/Pragya-EXP2
- SGLang
How to use RuVI-AI/Pragya-EXP2 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 "RuVI-AI/Pragya-EXP2" \ --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": "RuVI-AI/Pragya-EXP2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "RuVI-AI/Pragya-EXP2" \ --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": "RuVI-AI/Pragya-EXP2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RuVI-AI/Pragya-EXP2 with Docker Model Runner:
docker model run hf.co/RuVI-AI/Pragya-EXP2
Update README.md
Browse files
README.md
CHANGED
|
@@ -191,10 +191,11 @@ out = model.generate(
|
|
| 191 |
max_new_tokens=60,
|
| 192 |
do_sample=True,
|
| 193 |
temperature=0.7,
|
| 194 |
-
top_k=
|
| 195 |
repetition_penalty=1.3,
|
| 196 |
no_repeat_ngram_size=3,
|
| 197 |
pad_token_id=tok.pad_token_id,
|
|
|
|
| 198 |
)
|
| 199 |
print(tok.decode(out[0], skip_special_tokens=True))
|
| 200 |
```
|
|
@@ -219,9 +220,10 @@ These settings gave fluent, on-topic output in testing:
|
|
| 219 |
|
| 220 |
```text
|
| 221 |
temperature 0.7
|
| 222 |
-
top_k
|
| 223 |
repetition_penalty 1.3
|
| 224 |
no_repeat_ngram 3
|
|
|
|
| 225 |
```
|
| 226 |
|
| 227 |
Greedy decoding (`do_sample=False`) repeats phrases after a few sentences, so use sampling.
|
|
|
|
| 191 |
max_new_tokens=60,
|
| 192 |
do_sample=True,
|
| 193 |
temperature=0.7,
|
| 194 |
+
top_k=40,
|
| 195 |
repetition_penalty=1.3,
|
| 196 |
no_repeat_ngram_size=3,
|
| 197 |
pad_token_id=tok.pad_token_id,
|
| 198 |
+
top_p=0.95
|
| 199 |
)
|
| 200 |
print(tok.decode(out[0], skip_special_tokens=True))
|
| 201 |
```
|
|
|
|
| 220 |
|
| 221 |
```text
|
| 222 |
temperature 0.7
|
| 223 |
+
top_k 40
|
| 224 |
repetition_penalty 1.3
|
| 225 |
no_repeat_ngram 3
|
| 226 |
+
top_p 0.95
|
| 227 |
```
|
| 228 |
|
| 229 |
Greedy decoding (`do_sample=False`) repeats phrases after a few sentences, so use sampling.
|