Instructions to use xsanskarx/calculator-smollm2_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xsanskarx/calculator-smollm2_v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xsanskarx/calculator-smollm2_v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("xsanskarx/calculator-smollm2_v2") model = AutoModelForCausalLM.from_pretrained("xsanskarx/calculator-smollm2_v2") 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 xsanskarx/calculator-smollm2_v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xsanskarx/calculator-smollm2_v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xsanskarx/calculator-smollm2_v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/xsanskarx/calculator-smollm2_v2
- SGLang
How to use xsanskarx/calculator-smollm2_v2 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 "xsanskarx/calculator-smollm2_v2" \ --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": "xsanskarx/calculator-smollm2_v2", "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 "xsanskarx/calculator-smollm2_v2" \ --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": "xsanskarx/calculator-smollm2_v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use xsanskarx/calculator-smollm2_v2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xsanskarx/calculator-smollm2_v2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xsanskarx/calculator-smollm2_v2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for xsanskarx/calculator-smollm2_v2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="xsanskarx/calculator-smollm2_v2", max_seq_length=2048, ) - Docker Model Runner
How to use xsanskarx/calculator-smollm2_v2 with Docker Model Runner:
docker model run hf.co/xsanskarx/calculator-smollm2_v2
Uploaded model
- Developed by: xsanskarx
- License: apache-2.0
- Finetuned from model : HuggingFaceTB/SmolLM2-360M-Instruct
license: apache-2.0 tags: - unsloth - trl - sft
Calculator-SMoL-LM2 v1 - LLM Calculator Experiment
Re finetuning it currenlty , this model is not that goo
previous v1calculator-smollm2_v1
π¨ Disclaimer π¨
This model is a work in progress!
- The current version (
calculator-smollm2_v2) is an experimental model trained on a small subset of synthetic data (700,000 rows). - Dataset scaling is ongoing, and future versions will be trained on larger and more diverse datasets.
- This model is not production-ready and is intended for educational and experimental purposes only.
- The base model used is
smollm2-360m-instructfrom Hugging Face.
Use this model with caution, and do not rely on it for critical or real-world applications.
Model Description
Calculator-SMoL-LM2 v1 is a small language model fine-tuned on a synthetic dataset of arithmetic operations and comparisons. The model is designed to perform basic mathematical calculations and comparisons, such as addition, subtraction, multiplication, division, square roots, and equality checks. This is an experimental model trained on 700,000 rows of data generated using a custom script.
Intended Use
This model is intended for educational and experimental purposes. It can be used to:
- Perform basic arithmetic operations (+, -, *, /).
- Calculate square roots.
- Compare numbers (>, <, =).
The model is not intended for real-world applications requiring high precision or reliability.
Limitations
- Precision: The model is trained on synthetic data with limited precision (up to 5 decimal places). It may not handle very large numbers or highly precise calculations well.
- Generalization: The model may struggle with inputs that deviate significantly from the training data distribution.
- Error Handling: The model does not handle invalid inputs (e.g., division by zero) gracefully.
- Scope: The model is limited to the operations it was trained on and may not generalize to more complex mathematical tasks.
Training Data
The model was trained on a synthetic dataset of 700,000 rows, generated using the following operations:
- Addition (
+) - Subtraction (
-) - Multiplication (
*) - Division (
/) - Square Root (
srqt) - Comparisons (
=,>,<)
The dataset includes numbers with 3 to 10 digits in the integer part and up to 5 decimal places.
- Downloads last month
- 4
Model tree for xsanskarx/calculator-smollm2_v2
Base model
HuggingFaceTB/SmolLM2-360M