Instructions to use Susant-Achary/smolLM2-recipes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Susant-Achary/smolLM2-recipes with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-360M") model = PeftModel.from_pretrained(base_model, "Susant-Achary/smolLM2-recipes") - Transformers
How to use Susant-Achary/smolLM2-recipes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Susant-Achary/smolLM2-recipes")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Susant-Achary/smolLM2-recipes", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Susant-Achary/smolLM2-recipes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Susant-Achary/smolLM2-recipes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Susant-Achary/smolLM2-recipes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Susant-Achary/smolLM2-recipes
- SGLang
How to use Susant-Achary/smolLM2-recipes 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 "Susant-Achary/smolLM2-recipes" \ --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": "Susant-Achary/smolLM2-recipes", "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 "Susant-Achary/smolLM2-recipes" \ --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": "Susant-Achary/smolLM2-recipes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Susant-Achary/smolLM2-recipes with Docker Model Runner:
docker model run hf.co/Susant-Achary/smolLM2-recipes
Model Card for Susant-Achary/smolLM2-recipes
This is a 360-million-parameter causal language model, fine-tuned with LoRA adapters on a cleaned Indian recipe dataset. It generates step-by-step cooking instructions in English.
Model Details
Model Description
A compact transformer-decoder causal language model (360M parameters) originally from HuggingFaceTB/SmolLM2-360M, enhanced with low-rank adapter finetuning (LoRA) on ~22K Indian recipes (EmTpro01/indian-recipe-cleaned). Ideal for generating detailed, structured recipe instructions.
- Developed by: Susant Achary
- Model type: Causal Language Model (decoder-only transformer)
- Language(s): English
- License: Apache-2.0
- Finetuned from: HuggingFaceTB/SmolLM2-360M
Model Sources
- Hugging Face Hub: https://huggingface.co/Susant-Achary/smolLM2-recipes
- Dataset: EmTpro01/indian-recipe-cleaned on Hugging Face Datasets
Uses
Direct Use
- Generate detailed, step-by-step Indian recipe instructions given a recipe title and ingredient list.
- Integrate into cooking chatbots or recipe suggestion systems.
Downstream Use
- Fine-tune further for multilingual or specialized dietary versions.
- Plug into kitchen assistant apps or voice-controlled cooking aids.
Out-of-Scope Use
- Nutritional analysis or precise caloric computation (model does not predict nutritional values).
- Medical or allergy advice—recommend consulting a qualified professional.
Bias, Risks, and Limitations
The model reflects the distribution of the training data (predominantly North and South Indian recipes). It may reproduce cultural biases (e.g., under-representation of certain regional cuisines) and occasional inconsistencies in ingredient quantities or cooking times.
Recommendations
- Validate generated recipes before use.
- Provide user feedback loops to catch and correct errors.
- Augment with nutritional or safety checks from external sources.
How to Get Started with the Model
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("Susant-Achary/smolLM2-recipes")
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained("Susant-Achary/smolLM2-recipes", device_map="auto")
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = (
"### Recipe: Masala Dosa\n"
"### Ingredients:\n"
"rice, urad dal, fenugreek seeds, potato, onion, mustard seeds, curry leaves\n\n"
"### Instructions:\n"
)
print(generator(prompt, max_length=200, do_sample=True, top_p=0.9))
- Downloads last month
- 17
Model tree for Susant-Achary/smolLM2-recipes
Base model
HuggingFaceTB/SmolLM2-360M