Instructions to use ArushBuilds/Pragya-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArushBuilds/Pragya-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ArushBuilds/Pragya-Preview")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ArushBuilds/Pragya-Preview", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ArushBuilds/Pragya-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ArushBuilds/Pragya-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ArushBuilds/Pragya-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ArushBuilds/Pragya-Preview
- SGLang
How to use ArushBuilds/Pragya-Preview 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 "ArushBuilds/Pragya-Preview" \ --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": "ArushBuilds/Pragya-Preview", "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 "ArushBuilds/Pragya-Preview" \ --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": "ArushBuilds/Pragya-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ArushBuilds/Pragya-Preview with Docker Model Runner:
docker model run hf.co/ArushBuilds/Pragya-Preview
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
datasets:
|
|
@@ -53,8 +54,10 @@ Ensure you have PyTorch and Hugging Face `transformers` installed:
|
|
| 53 |
pip install torch transformers
|
| 54 |
|
| 55 |
```
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
import torch
|
| 59 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 60 |
|
|
@@ -85,4 +88,37 @@ outputs = model.generate(
|
|
| 85 |
|
| 86 |
story = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 87 |
print("\n--- Generated Story ---")
|
| 88 |
-
print(story)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```markdown
|
| 2 |
---
|
| 3 |
license: apache-2.0
|
| 4 |
datasets:
|
|
|
|
| 54 |
pip install torch transformers
|
| 55 |
|
| 56 |
```
|
| 57 |
+
|
| 58 |
+
### 2. Inference Code
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
import torch
|
| 62 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 63 |
|
|
|
|
| 88 |
|
| 89 |
story = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 90 |
print("\n--- Generated Story ---")
|
| 91 |
+
print(story)
|
| 92 |
+
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## Training Setup
|
| 98 |
+
|
| 99 |
+
| Parameter | Configuration |
|
| 100 |
+
| --- | --- |
|
| 101 |
+
| **Hardware** | 1x NVIDIA T4 GPU (Google Colab Free Tier) |
|
| 102 |
+
| **Training Duration** | ~1 hour |
|
| 103 |
+
| **Dataset** | `roneneldan/TinyStories` |
|
| 104 |
+
| **Framework** | PyTorch + Hugging Face Transformers |
|
| 105 |
+
|
| 106 |
+
---
|
| 107 |
+
|
| 108 |
+
## Citation & Acknowledgments
|
| 109 |
+
|
| 110 |
+
If you use or reference **Pragya Preview**, please credit the underlying dataset:
|
| 111 |
+
|
| 112 |
+
```bibtex
|
| 113 |
+
@article{eldan2023tinystories,
|
| 114 |
+
title={TinyStories: How Small Can Language Models Be and Still Speak Coherent English?},
|
| 115 |
+
author={Eldan, Ronen and Li, Yuanzhi},
|
| 116 |
+
journal={arXiv preprint arXiv:2305.07759},
|
| 117 |
+
year={2023}
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
```
|