thibaud-perrin
commited on
Commit
•
5fca777
1
Parent(s):
311a1e4
Update README.md
Browse files
README.md
CHANGED
@@ -1,201 +1,143 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
# Model Card for
|
7 |
|
8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
|
|
|
|
|
|
10 |
|
|
|
11 |
|
12 |
-
## Model Details
|
13 |
-
|
14 |
-
### Model Description
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
- **Developed by:** [More Information Needed]
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
### Model
|
29 |
|
30 |
-
|
31 |
|
32 |
-
- **
|
33 |
-
- **
|
34 |
-
- **
|
|
|
|
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
39 |
|
40 |
### Direct Use
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
|
52 |
### Out-of-Scope Use
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
|
58 |
## Bias, Risks, and Limitations
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
|
64 |
### Recommendations
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
|
70 |
## How to Get Started with the Model
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
## Training Details
|
77 |
|
78 |
### Training Data
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
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 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
- **
|
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 |
-
|
200 |
|
|
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
license: mit
|
4 |
+
datasets:
|
5 |
+
- thibaud-perrin/hibo-function-calling-v1
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
pipeline_tag: text-generation
|
9 |
---
|
10 |
|
11 |
+
# Model Card for thibaud-perrin/hibo-mistral-7b-fc-v1.3
|
12 |
|
|
|
13 |
|
14 |
+
<div align="center">
|
15 |
+
<img src="./img/banner2.webp" width="100%" />
|
16 |
+
</div>
|
17 |
|
18 |
+
[![GitHub](https://img.shields.io/badge/GitHub-Repository-blue.svg)](https://github.com/thibaud-perrin/hibo-mistral-7b-fc)
|
19 |
|
|
|
|
|
|
|
20 |
|
21 |
+
This model is a fine-tuned version of the `mistralai/Mistral-7B-v0.1` for the purpose of instruction following and function calling tasks. It is designed to understand and generate responses based on given instructions or function calls.
|
22 |
|
23 |
+
## Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
### Model Description
|
26 |
|
27 |
+
Developed by Thibaud Perrin, this model is fine-tuned specifically for the task of interpreting instructions and generating appropriate responses or function calls in English. It leverages the power of the Mistral-7B model, adapting its capabilities to more targeted use cases.
|
28 |
|
29 |
+
- **Developed by:** Thibaud Perrin
|
30 |
+
- **Model type:** CAUSAL_LM
|
31 |
+
- **Language(s) (NLP):** English
|
32 |
+
- **License:** MIT
|
33 |
+
- **Finetuned from model:** Mistral-7B
|
34 |
|
35 |
## Uses
|
36 |
|
37 |
+
This model is intended for developers, researchers, and hobbyists looking for a pre-trained model capable of understanding and responding to instructions or executing function calls within a given context.
|
38 |
|
39 |
### Direct Use
|
40 |
|
41 |
+
The model can be directly used via the Hugging Face Transformers library for generating text based on prompts related to instructions or function calls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
### Out-of-Scope Use
|
44 |
|
45 |
+
This model is not intended for high-stakes decisions or scenarios where misunderstanding instructions could lead to significant consequences.
|
|
|
|
|
46 |
|
47 |
## Bias, Risks, and Limitations
|
48 |
|
49 |
+
As with any language model, there's a risk of generating biased or inappropriate content. Users should be cautious and evaluate the model's outputs within their specific context.
|
|
|
|
|
50 |
|
51 |
### Recommendations
|
52 |
|
53 |
+
Users should monitor the model's outputs and apply additional filtering or moderation as needed to ensure the generated content is appropriate for their use case.
|
|
|
|
|
54 |
|
55 |
## How to Get Started with the Model
|
56 |
|
57 |
+
```python
|
58 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
59 |
+
|
60 |
+
model_identifier = "thibaud-perrin/hibo-mistral-7b-fc-v1.3"
|
61 |
+
model = AutoModelForCausalLM.from_pretrained(
|
62 |
+
model_identifier,
|
63 |
+
low_cpu_mem_usage=True,
|
64 |
+
return_dict=True,
|
65 |
+
torch_dtype=torch.bfloat16,
|
66 |
+
device_map={"": 0},
|
67 |
+
)
|
68 |
+
tokenizer = AutoTokenizer.from_pretrained(model_identifier)
|
69 |
+
|
70 |
+
device = 'cuda:0'
|
71 |
+
# device = 'cpu'
|
72 |
+
model.config.use_cache = True
|
73 |
+
model.eval()
|
74 |
+
model.to(device)
|
75 |
+
|
76 |
+
def stream(user_prompt):
|
77 |
+
system_prompt = """You are a helpful assistant with access to the following functions. Use them if required -
|
78 |
+
{
|
79 |
+
"name": "get_stock_price",
|
80 |
+
"description": "Get the current stock price of a company",
|
81 |
+
"parameters": {
|
82 |
+
"type": "object",
|
83 |
+
"properties": {
|
84 |
+
"company_name": {
|
85 |
+
"type": "string",
|
86 |
+
"description": "The name of the company"
|
87 |
+
},
|
88 |
+
"exchange": {
|
89 |
+
"type": "string",
|
90 |
+
"description": "The stock exchange where the company is listed"
|
91 |
+
}
|
92 |
+
},
|
93 |
+
"required": [
|
94 |
+
"company_name",
|
95 |
+
"exchange"
|
96 |
+
]
|
97 |
+
}
|
98 |
+
}
|
99 |
+
"""
|
100 |
+
messages = [
|
101 |
+
{"role": "system", "content": system_prompt},
|
102 |
+
{"role": "user", "content": user_prompt.strip()}
|
103 |
+
]
|
104 |
+
|
105 |
+
transformed_data = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
|
106 |
+
eos_token_id = tokenizer.eos_token_id
|
107 |
+
inputs = tokenizer([transformed_data], return_tensors="pt", add_special_tokens=True).to(device)
|
108 |
+
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=False)
|
109 |
+
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=512, eos_token_id=tokenizer.eos_token_id, early_stopping=True)
|
110 |
+
stream("Hi, can you tell me the current stock price of Apple on NASDAQ? ")
|
111 |
+
```
|
112 |
|
113 |
## Training Details
|
114 |
|
115 |
### Training Data
|
116 |
|
117 |
+
The model was trained using the dataset `thibaud-perrin/hibo-function-calling-v1`, which consists of various instruction-following and function-calling examples.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
#### Summary
|
120 |
|
121 |
+
The fine-tuned model demonstrates a significant improvement in understanding and generating instruction-based responses compared to the base Mistral-7B model.
|
122 |
+
However this model has been trained, only on the first 50_000 rows of the dataset, with one epoch.
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
## Environmental Impact
|
125 |
|
126 |
+
- **Hardware Type:** A100 - 40GB
|
127 |
+
- **Hours used:** 48H
|
128 |
+
- **Cloud Provider:** Google Colab
|
129 |
+
- **Compute Region:** France
|
130 |
+
- **Carbon Emitted:** Estimates needed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
+
## 📚 Citation
|
133 |
|
134 |
+
Please cite this dataset using the following BibTeX entry:
|
135 |
|
136 |
+
```bibtex
|
137 |
+
@misc{hibo-mistral-7b-fc-v1.3,
|
138 |
+
author = Thibaud Perrin,
|
139 |
+
title = hibo-mistral-7b-fc-v1.3: An instruct Model for Function Calling in Conversational AI,
|
140 |
+
year = 2024,
|
141 |
+
publisher = Hugging Face,
|
142 |
+
}
|
143 |
+
```
|