Instructions to use aaptknews/BHARAT-AI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aaptknews/BHARAT-AI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aaptknews/BHARAT-AI")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aaptknews/BHARAT-AI", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aaptknews/BHARAT-AI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aaptknews/BHARAT-AI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aaptknews/BHARAT-AI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aaptknews/BHARAT-AI
- SGLang
How to use aaptknews/BHARAT-AI 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 "aaptknews/BHARAT-AI" \ --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": "aaptknews/BHARAT-AI", "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 "aaptknews/BHARAT-AI" \ --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": "aaptknews/BHARAT-AI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aaptknews/BHARAT-AI with Docker Model Runner:
docker model run hf.co/aaptknews/BHARAT-AI
Update README.md
#1
by prabhjotdhaliwal - opened
README.md
CHANGED
|
@@ -1,18 +1,4 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
datasets:
|
| 6 |
-
- fka/awesome-chatgpt-prompts
|
| 7 |
-
- wikimedia/wikipedia
|
| 8 |
-
- Lin-Chen/ShareGPT4V
|
| 9 |
-
language:
|
| 10 |
-
- en
|
| 11 |
-
- hi
|
| 12 |
-
- bh
|
| 13 |
-
metrics:
|
| 14 |
-
- accuracy
|
| 15 |
-
tags:
|
| 16 |
-
- code
|
| 17 |
-
---
|
| 18 |
-
pip install transformers
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
ai = pipeline("text-generation", model="mistralai/Mistral-7B-v0.1")
|
| 3 |
+
print(ai("Summarize immigration documents"))
|
| 4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|