Text Generation
Transformers
Safetensors
Vietnamese
English
qwen2
recipe
cooking
vietnamese
lora
sft
conversational
text-generation-inference
Instructions to use NotIsora/Qwen2.5-7B-Chef-VN with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NotIsora/Qwen2.5-7B-Chef-VN with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NotIsora/Qwen2.5-7B-Chef-VN") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NotIsora/Qwen2.5-7B-Chef-VN") model = AutoModelForCausalLM.from_pretrained("NotIsora/Qwen2.5-7B-Chef-VN", 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 NotIsora/Qwen2.5-7B-Chef-VN with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NotIsora/Qwen2.5-7B-Chef-VN" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NotIsora/Qwen2.5-7B-Chef-VN", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NotIsora/Qwen2.5-7B-Chef-VN
- SGLang
How to use NotIsora/Qwen2.5-7B-Chef-VN 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 "NotIsora/Qwen2.5-7B-Chef-VN" \ --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": "NotIsora/Qwen2.5-7B-Chef-VN", "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 "NotIsora/Qwen2.5-7B-Chef-VN" \ --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": "NotIsora/Qwen2.5-7B-Chef-VN", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NotIsora/Qwen2.5-7B-Chef-VN with Docker Model Runner:
docker model run hf.co/NotIsora/Qwen2.5-7B-Chef-VN
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,6 +48,9 @@ The model should not be used for:
|
|
| 48 |
- Generating harmful, toxic, or unsafe content.
|
| 49 |
- Tasks entirely unrelated to food, cooking, or culinary arts (its performance may degrade outside its specialized domain).
|
| 50 |
|
|
|
|
|
|
|
|
|
|
| 51 |
## Bias, Risks, and Limitations
|
| 52 |
|
| 53 |
While the model generates detailed recipes, cooking involves physical safety (e.g., using knives, handling hot surfaces, food safety/allergies). Users should exercise common sense and verify food safety standards independently. The model may occasionally hallucinate ingredients or steps that do not perfectly align with traditional recipes.
|
|
@@ -89,4 +92,43 @@ with torch.inference_mode():
|
|
| 89 |
)
|
| 90 |
|
| 91 |
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
|
| 92 |
-
print(response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
- Generating harmful, toxic, or unsafe content.
|
| 49 |
- Tasks entirely unrelated to food, cooking, or culinary arts (its performance may degrade outside its specialized domain).
|
| 50 |
|
| 51 |
+
## If you want to train by yourself
|
| 52 |
+
|
| 53 |
+
|
| 54 |
## Bias, Risks, and Limitations
|
| 55 |
|
| 56 |
While the model generates detailed recipes, cooking involves physical safety (e.g., using knives, handling hot surfaces, food safety/allergies). Users should exercise common sense and verify food safety standards independently. The model may occasionally hallucinate ingredients or steps that do not perfectly align with traditional recipes.
|
|
|
|
| 92 |
)
|
| 93 |
|
| 94 |
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
|
| 95 |
+
print(response)
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
## Training Details
|
| 99 |
+
### Training Data
|
| 100 |
+
- The model was trained on a processed subset of the AkashPS11/recipes_data_food.com dataset. The data was filtered, parsed, and converted into ChatML format to simulate a user asking for a recipe and a chef responding with structured instructions.
|
| 101 |
+
|
| 102 |
+
### Training Procedure
|
| 103 |
+
- The model was trained using parameter-efficient fine-tuning (QLoRA) to optimize VRAM usage while maintaining performance.
|
| 104 |
+
|
| 105 |
+
### Training Hyperparameters
|
| 106 |
+
- Training regime: bf16 mixed precision
|
| 107 |
+
- Epochs: 6
|
| 108 |
+
- Max Sequence Length: 1024
|
| 109 |
+
- Per-device Batch Size: 2
|
| 110 |
+
- Gradient Accumulation Steps: 4
|
| 111 |
+
- Optimizer: paged_adamw_8bit
|
| 112 |
+
- Learning Rate: 5e-5
|
| 113 |
+
- Learning Rate Scheduler: Cosine
|
| 114 |
+
- Warmup Ratio: 0.1
|
| 115 |
+
- LoRA Rank (r): 16
|
| 116 |
+
- LoRA Alpha: 32
|
| 117 |
+
|
| 118 |
+
## Technical Specifications
|
| 119 |
+
### Compute Infrastructure:
|
| 120 |
+
- The model was trained on Google Colab.
|
| 121 |
+
|
| 122 |
+
## Hardware:
|
| 123 |
+
- GPU: 1x NVIDIA L4 / T4 Tensor Core GPU
|
| 124 |
+
|
| 125 |
+
### Software:
|
| 126 |
+
- PyTorch
|
| 127 |
+
- Transformers
|
| 128 |
+
- PEFT
|
| 129 |
+
TRL
|
| 130 |
+
- BitsAndBytes
|
| 131 |
+
- FlashAttention / SDPA
|
| 132 |
+
|
| 133 |
+
Model Card Contact
|
| 134 |
+
For any questions, issues, or collaborations, feel free to reach out via Hugging Face.
|