Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,91 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
|
|
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
-
|
| 26 |
-
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
[
|
| 45 |
-
|
| 46 |
-
#
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
license: cc-by-nc-4.0
|
| 4 |
+
datasets:
|
| 5 |
+
- Sadiah/Go-Gourmet
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# Go-Gourmet Fine-Tuned Mistral 7B Model
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6564e76de6b20bc37e494589/e7-63vc6Rxq6HAMmHXZ5p.png" width="600" alt="Gollum Tonality Fine-Tuned LLAMA-2 7B Model inference code">
|
| 13 |
|
| 14 |
+
## Overview
|
| 15 |
+
The Go-Gourmet model is a fine-tuned version of the `mistralai/Mistral-7B-Instruct-v0.2` base model with 32k context window, specifically trained to generate structured restaurant cards based on an input of a restaurant name and location. The model has been fine-tuned using a custom dataset of restaurant information to capture relevant details such as cuisine, opening times, location, rating, average price, best dishes, pre-booking requirements, dress code, and website.
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
+
* **Base Model**: `mistralai/Mistral-7B-Instruct-v0.2`.
|
| 19 |
+
* **Fine-Tuning Dataset**: Custom dataset of restaurant information `Sadiah/Go-Gourmet`.
|
| 20 |
+
* **Fine-Tuning Approach**: `QLoRA` and `SFT Trainer`.
|
| 21 |
+
* **Model Size**: The model retains the same size and architecture as the original Mistral base model.
|
| 22 |
+
|
| 23 |
+
## Intended Use
|
| 24 |
+
The Go-Gourmet Fine-Tuned Mistral Model is designed to generate structured restaurant cards based on an input of a restaurant name and location. It can be used for various purposes, such as:
|
| 25 |
+
* Generating informative restaurant cards for food and travel applications
|
| 26 |
+
* Providing quick and structured information about restaurants to users
|
| 27 |
+
* Enhancing natural language processing applications related to the food and hospitality industry
|
| 28 |
+
|
| 29 |
+
## Limitations and Considerations
|
| 30 |
+
* The model's outputs are generated based on patterns and characteristics learned from the fine-tuning dataset. While it aims to provide accurate and relevant information, the generated restaurant cards may not always be perfect or up-to-date.
|
| 31 |
+
* The model relies on the quality and comprehensiveness of the fine-tuning dataset. If certain details or categories are missing from the dataset, the model may not be able to generate them accurately.
|
| 32 |
+
* The generated restaurant cards should be used as a starting point and should be verified with official sources or the restaurants themselves for the most accurate and current information.
|
| 33 |
+
|
| 34 |
+
## Inference Code
|
| 35 |
+
To test and interact with the Go-Gourmet Fine-Tuned Mistral Model, you can use the following inference code:
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
# Load the fine-tuned model from hugging face
|
| 39 |
+
import torch
|
| 40 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
+
tokenizer_new = AutoTokenizer.from_pretrained("Sadiah/Go-Gourmet")
|
| 42 |
+
model_new = AutoModelForCausalLM.from_pretrained(
|
| 43 |
+
"Sadiah/Go-Gourmet",
|
| 44 |
+
trust_remote_code=True,
|
| 45 |
+
torch_dtype=torch.float16,
|
| 46 |
+
device_map= {"": 0},
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
input_text = '''[INST]Olives, Delhi [/INST]''' #Define instruction
|
| 50 |
+
input_ids = tokenizer_new(input_text, return_tensors="pt") #Tokenize instruction
|
| 51 |
+
input_ids = input_ids.to("cuda") #Move instruction to GPU
|
| 52 |
+
outputs = model_new.generate(**input_ids, max_length=300, num_return_sequences=1, temperature=0) #Generate response
|
| 53 |
+
generated_text = tokenizer_new.decode(outputs[0]) #Decode generated response
|
| 54 |
+
|
| 55 |
+
# Find the index of the closing instruction tag and remove the instruction
|
| 56 |
+
instruction_end_index = generated_text.find("[/INST]")
|
| 57 |
+
if instruction_end_index != -1:
|
| 58 |
+
generated_text = generated_text[instruction_end_index + len("[/INST]"):].strip()
|
| 59 |
+
|
| 60 |
+
# Find the index of "Website:" and the end of the website address
|
| 61 |
+
website_start_index = generated_text.find("Website:")
|
| 62 |
+
if website_start_index != -1:
|
| 63 |
+
website_end_index = generated_text.find("\n", website_start_index)
|
| 64 |
+
if website_end_index == -1:
|
| 65 |
+
website_end_index = len(generated_text)
|
| 66 |
+
truncated_text = generated_text[:website_end_index]
|
| 67 |
+
print(truncated_text.strip())
|
| 68 |
+
else:
|
| 69 |
+
print(generated_text)
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
Name: Olives, Delhi
|
| 74 |
+
Cuisine: Mediterranean
|
| 75 |
+
Opening Times: Mon-Sun: 12:30pm-3:30pm, 7pm-11:30pm
|
| 76 |
+
Location: 1, Kalka Das Marg, New Delhi, Delhi 110001, India (28.7031, 77.1123)
|
| 77 |
+
Rating: 4.3 (Source: Zomato)
|
| 78 |
+
Average Price Per Person: Moderate
|
| 79 |
+
Three Best Dishes:
|
| 80 |
+
1. Grilled Halloumi Cheese: A popular Mediterranean cheese, grilled to perfection.
|
| 81 |
+
2. Falafel Platter: A selection of crispy, flavorful falafel balls served with hummus and pita bread.
|
| 82 |
+
3. Lamb Shank Tagine: Slow-cooked lamb shank in a rich, aromatic sauce.
|
| 83 |
+
Pre-Booking Needed: Recommended, especially for dinner
|
| 84 |
+
Dress Code: Casual
|
| 85 |
+
Website: http://www.olivesdelhi.com/
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
This code snippet allows you to provide an input of a restaurant name and location and generate a structured restaurant card using the Go-Gourmet Fine-Tuned Mistral Model.
|
| 89 |
+
|
| 90 |
+
## Contact and Feedback
|
| 91 |
+
If you have any questions, feedback, or concerns regarding the Go-Gourmet Fine-Tuned Mistral Model, please contact me at https://www.sadiahzahoor.com/contact .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|