Text Generation
Transformers
Safetensors
llama
llama-factory
conversational
text-generation-inference
Instructions to use Onkarn/ML-Test-v01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Onkarn/ML-Test-v01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Onkarn/ML-Test-v01") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Onkarn/ML-Test-v01") model = AutoModelForCausalLM.from_pretrained("Onkarn/ML-Test-v01") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Onkarn/ML-Test-v01 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Onkarn/ML-Test-v01" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Onkarn/ML-Test-v01", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Onkarn/ML-Test-v01
- SGLang
How to use Onkarn/ML-Test-v01 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 "Onkarn/ML-Test-v01" \ --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": "Onkarn/ML-Test-v01", "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 "Onkarn/ML-Test-v01" \ --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": "Onkarn/ML-Test-v01", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Onkarn/ML-Test-v01 with Docker Model Runner:
docker model run hf.co/Onkarn/ML-Test-v01
Update README.md
#1
by Haaaaarsh - opened
README.md
CHANGED
|
@@ -141,15 +141,12 @@ Use the code below to get started with the model.
|
|
| 141 |
|
| 142 |
## Environmental Impact
|
| 143 |
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
- **
|
| 149 |
-
|
| 150 |
-
- **Cloud Provider:** [More Information Needed]
|
| 151 |
-
- **Compute Region:** [More Information Needed]
|
| 152 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 153 |
|
| 154 |
## Technical Specifications [optional]
|
| 155 |
|
|
|
|
| 141 |
|
| 142 |
## Environmental Impact
|
| 143 |
|
| 144 |
+
- **Hardware Type:** T4
|
| 145 |
+
- **Hours used:** 29 hours
|
| 146 |
+
- **Cloud Provider:** Google Cloud Platform
|
| 147 |
+
- **Compute Region:** asia-southeast1
|
| 148 |
+
- **Carbon Emitted:** Total emissions are estimated to be 0.85 kgCO$_2$eq of which 100 percents were directly offset by the cloud provider.
|
| 149 |
+
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
## Technical Specifications [optional]
|
| 152 |
|