--- license: mit tags: - text-generation - meal-reviews - fine-tuned - mistral datasets: - shuyangli94/food-com-recipes-and-user-interactions language: - en base_model: mistralai/Mistral-7B-Instruct-v0.3 --- # Merged Mistral 7B Fine-Tuned for Meal Reviews ## Overview This repository contains a fine-tuned version of the [Mistral 7B Instruct v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) model, specialized for generating high-quality meal reviews. The model was created by merging a LoRA adapter (available at [Oliver1703dk/meal_review_fine_tuned_adapter_bigger](https://huggingface.co/Oliver1703dk/meal_review_fine_tuned_adapter_bigger)) with the base Mistral 7B model, using the Food.com dataset for fine-tuning. ## Model Details - **Base Model**: [mistralai/Mistral-7B-Instruct-v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) - **Fine-Tuning Method**: LoRA (Low-Rank Adaptation), merged with the base model - **Task**: Text generation for meal reviews - **Training Data**: The [Food.com Recipes and User Interactions](https://www.kaggle.com/datasets/shuyangli94/food-com-recipes-and-user-interactions) dataset, specifically the user review text. The dataset contains over 700,000 recipe reviews, which were preprocessed to focus on review generation. - **Training Steps**: 12,714 steps ## Usage The model can be used directly for inference with the library. Below is an example of how to load and use the model. ### Installation ```bash pip install transformers torch ``` ### Example Code ```python from transformers import AutoModelForCausalLM, AutoTokenizer import torch # Load model and tokenizer model = AutoModelForCausalLM.from_pretrained( "Oliver1703dk/meal_review_merged_mistral_finetuned_bigger", torch_dtype=torch.float16, device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained("Oliver1703dk/meal_review_merged_mistral_finetuned_bigger") # Inference prompt = "Write a review for a delicious Italian meal." inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_length=200) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. ## Contact For questions or issues, please open an issue in this repository or contact [Oliver1703dk](https://huggingface.co/Oliver1703dk). --- *Generated on April 29, 2025*