Text Generation
Transformers
Safetensors
English
llama
Generated from Trainer
grpo
trl
math
calculator
conversational
text-generation-inference
Instructions to use AbleCredit/Llama-3.2-1B-Calculator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AbleCredit/Llama-3.2-1B-Calculator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AbleCredit/Llama-3.2-1B-Calculator") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AbleCredit/Llama-3.2-1B-Calculator") model = AutoModelForCausalLM.from_pretrained("AbleCredit/Llama-3.2-1B-Calculator", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AbleCredit/Llama-3.2-1B-Calculator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AbleCredit/Llama-3.2-1B-Calculator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AbleCredit/Llama-3.2-1B-Calculator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AbleCredit/Llama-3.2-1B-Calculator
- SGLang
How to use AbleCredit/Llama-3.2-1B-Calculator 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 "AbleCredit/Llama-3.2-1B-Calculator" \ --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": "AbleCredit/Llama-3.2-1B-Calculator", "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 "AbleCredit/Llama-3.2-1B-Calculator" \ --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": "AbleCredit/Llama-3.2-1B-Calculator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AbleCredit/Llama-3.2-1B-Calculator with Docker Model Runner:
docker model run hf.co/AbleCredit/Llama-3.2-1B-Calculator
Update README.md
Browse files
README.md
CHANGED
|
@@ -52,19 +52,20 @@ Subtract 50 from 100, divide result by 2, then multiply by 10.
|
|
| 52 |
|
| 53 |
**Output**
|
| 54 |
```yaml
|
| 55 |
-
<calculator>
|
| 56 |
-
operation: "multiply"
|
| 57 |
-
operands:
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
</calculator>
|
| 67 |
```
|
|
|
|
| 68 |
---
|
| 69 |
|
| 70 |
## Training Dataset
|
|
@@ -188,6 +189,5 @@ if match:
|
|
| 188 |
|
| 189 |
## Research Work
|
| 190 |
|
| 191 |
-
This research work was carried out by
|
| 192 |
-
[Abinesh Mathivanan](https://www.linkedin.com/in/abineshmathivanan/)
|
| 193 |
|
|
|
|
| 52 |
|
| 53 |
**Output**
|
| 54 |
```yaml
|
| 55 |
+
<calculator>
|
| 56 |
+
operation: "multiply"
|
| 57 |
+
operands:
|
| 58 |
+
- operation: "divide"
|
| 59 |
+
operands:
|
| 60 |
+
- operation: "subtract"
|
| 61 |
+
operands:
|
| 62 |
+
- 100
|
| 63 |
+
- 50
|
| 64 |
+
- 2
|
| 65 |
+
- 10
|
| 66 |
+
</calculator>
|
| 67 |
```
|
| 68 |
+
|
| 69 |
---
|
| 70 |
|
| 71 |
## Training Dataset
|
|
|
|
| 189 |
|
| 190 |
## Research Work
|
| 191 |
|
| 192 |
+
This research work was carried out by [Abinesh Mathivanan](https://www.linkedin.com/in/abineshmathivanan/)
|
|
|
|
| 193 |
|