Instructions to use akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset") model = AutoModelForCausalLM.from_pretrained("akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset
- SGLang
How to use akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset 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 "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset" \ --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": "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset", "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 "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset" \ --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": "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset with Docker Model Runner:
docker model run hf.co/akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset
Model Card: akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset
Model Description This model is a fine-tuned version of SmolLM2-360M using physics instruction datasets from both synthetic physics questions and camel-ai physics. It is optimized for solving college-level physics word problems, with LoRA-based parameter-efficient fine-tuning to reduce memory footprint and enable efficient deployment.
- Base Model:
HuggingFaceTB/SmolLM2-360M - Instruction Datasets: Combination of instruction-tuned
camel-ai/physicsand custom-generated synthetic datasets - Framework:
transformers,trl,peft - Evaluation Task: MMLU –
college_physics - Training Loss: ~0.14
- Validation Loss: 0.48 (best at epoch 11)
- Training Time: ~13,000 seconds
- Steps: 4926 steps with batch size 4 and accumulation 4
Use Cases This model is intended for:
- Physics education tools
- College-level physics question answering
- Low-resource inference applications (thanks to LoRA)
Training Details
- Hardware: NVIDIA A5500 24GB
- Precision: bf16 if available, else fp16
- Optimizer:
adamw_8bit - Epochs: 11
- Scheduler: Linear
- Learning Rate: 2e-5
Performance
| Metric | Value |
|---|---|
| Training Loss | 0.1419 |
| Validation Loss | 0.4764 |
| Best Epoch | 11 |
| Train Samples/sec | 24.42 |
| Steps/sec | 0.375 |
| Total FLOPs | 3.04e+17 |
How to Use
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
model_id = "akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = "Question: What is the acceleration of an object with mass 5 kg under a force of 20 N?\nAnswer:"
print(pipe(prompt, max_new_tokens=100)[0]["generated_text"])
Limitations
- Trained only on physics word problems – limited generalization outside this domain
- May not generalize to multi-step derivations or non-instructional questions
- Trained only on English prompts
Citation If you use this model, please cite:
@misc{vallala2025physmol,
title={PhysmolLM: A Compact Large Language Model for Enhancing Physics Education on Mobile Devices},
author={Akhil Vallala},
year={2025},
note={Master's Thesis, Florida Atlantic University}
}
- Downloads last month
- 14
Model tree for akhilfau/fine-tuned-smolLM2-360M-with-on-combined_Instruction_dataset
Base model
HuggingFaceTB/SmolLM2-360M