mohamedemam commited on
Commit
afd754a
1 Parent(s): 7dce4da

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -221
README.md CHANGED
@@ -107,7 +107,13 @@ tags:
107
  ---
108
 
109
  # Model Card for QA_GeneraToR
 
110
 
 
 
 
 
 
111
  # my fine tuned model
112
  >This model is fine tuned to generate a question with answers from a context , why that can be very usful this can help you to generate a dataset from a book article any thing you would to make from it dataset and train another model on this dataset , give the model any context with pre prometed of quation you want + context and it will extarct question + answer for you
113
  this are promted i use
@@ -123,224 +129,3 @@ this are promted i use
123
  <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/flan2_architecture.jpg"
124
  alt="drawing" width="600"/>
125
 
126
- # Table of Contents
127
-
128
- 0. [TL;DR](#TL;DR)
129
- 1. [Model Details](#model-details)
130
- 2. [Usage](#usage)
131
- 3. [Uses](#uses)
132
- 4. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
133
- 5. [Training Details](#training-details)
134
- 6. [Evaluation](#evaluation)
135
- 7. [Environmental Impact](#environmental-impact)
136
- 8. [Citation](#citation)
137
- 9. [Model Card Authors](#model-card-authors)
138
-
139
- # TL;DR
140
-
141
- If you already know T5, FLAN-T5 is just better at everything. For the same number of parameters, these models have been fine-tuned on more than 1000 additional tasks covering also more languages.
142
- As mentioned in the first few lines of the abstract :
143
- > Flan-PaLM 540B achieves state-of-the-art performance on several benchmarks, such as 75.2% on five-shot MMLU. We also publicly release Flan-T5 checkpoints,1 which achieve strong few-shot performance even compared to much larger models, such as PaLM 62B. Overall, instruction finetuning is a general method for improving the performance and usability of pretrained language models.
144
- # Model Details
145
-
146
- ## Model Description
147
-
148
-
149
- - **Model type:** Language model
150
- - **Language(s) (NLP):** English
151
- - **License:** mit
152
- - **Related Models:** [All FLAN-T5 Checkpoints](https://huggingface.co/models?search=flan-t5)
153
- - **Original Checkpoints:** [All Original FLAN-T5 Checkpoints](https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints)
154
- - **Resources for more information:**
155
- - [Research paper](https://arxiv.org/pdf/2210.11416.pdf)
156
- - [GitHub Repo](https://github.com/google-research/t5x)
157
- - [Hugging Face FLAN-T5 Docs (Similar to T5) ](https://huggingface.co/docs/transformers/model_doc/t5)
158
-
159
- # Usage
160
-
161
- Find below some example scripts on how to use the model in `transformers`:
162
-
163
- ## Using the Pytorch model
164
-
165
- ### Running the model on a CPU
166
-
167
- <details>
168
- <summary> Click to expand </summary>
169
-
170
- ```python
171
-
172
- from transformers import T5Tokenizer, T5ForConditionalGeneration
173
-
174
- tokenizer = T5Tokenizer.from_pretrained("mohamedemam/QA_GeneraToR")
175
- model = T5ForConditionalGeneration.from_pretrained("mohamedemam/QA_GeneraToR")
176
-
177
- input_text = r"when: Lionel Andrés Messi[note 1] (Spanish pronunciation: [ljoˈnel anˈdɾes ˈmesi] (listen); born 24 June 1987), also known as Leo Messi, is an Argentine professional footballer who plays as a forward for and captains both Major League Soccer club Inter Miami and the Argentina national team. Widely regarded as one of the greatest players of all time, Messi has won a record seven Ballon d'Or awards[note 2] and a record six European Golden Shoes, and in 2020 he was named to the Ballon d'Or Dream Team. Until leaving the club"
178
- input_ids = tokenizer(input_text, return_tensors="pt").input_ids
179
-
180
- outputs = model.generate(input_ids)
181
- print(tokenizer.decode(outputs[0]))
182
- ```
183
-
184
- </details>
185
-
186
- ### Running the model on a GPU
187
-
188
- <details>
189
- <summary> Click to expand </summary>
190
-
191
- ```python
192
- # pip install accelerate
193
- from transformers import T5Tokenizer, T5ForConditionalGeneration
194
-
195
- tokenizer = T5Tokenizer.from_pretrained("mohamedemam/QA_GeneraToR")
196
- model = T5ForConditionalGeneration.from_pretrained("mohamedemam/QA_GeneraToR", device_map="auto")
197
-
198
- input_text = r"when: Lionel Andrés Messi[note 1] (Spanish pronunciation: [ljoˈnel anˈdɾes ˈmesi] (listen); born 24 June 1987), also known as Leo Messi, is an Argentine professional footballer who plays as a forward for and captains both Major League Soccer club Inter Miami and the Argentina national team. Widely regarded as one of the greatest players of all time, Messi has won a record seven Ballon d'Or awards[note 2] and a record six European Golden Shoes, and in 2020 he was named to the Ballon d'Or Dream Team. Until leaving the club"
199
- input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
200
-
201
- outputs = model.generate(input_ids)
202
- print(tokenizer.decode(outputs[0]))
203
- ```
204
-
205
- </details>
206
-
207
- ### Running the model on a GPU using different precisions
208
-
209
- #### FP16
210
-
211
- <details>
212
- <summary> Click to expand </summary>
213
-
214
- ```python
215
- # pip install accelerate
216
- import torch
217
- from transformers import T5Tokenizer, T5ForConditionalGeneration
218
-
219
- tokenizer = T5Tokenizer.from_pretrained("mohamedemam/QA_GeneraToR")
220
- model = T5ForConditionalGeneration.from_pretrained("mohamedemam/QA_GeneraToR", device_map="auto", torch_dtype=torch.float16)
221
-
222
- input_text = r"when: Lionel Andrés Messi[note 1] (Spanish pronunciation: [ljoˈnel anˈdɾes ˈmesi] (listen); born 24 June 1987), also known as Leo Messi, is an Argentine professional footballer who plays as a forward for and captains both Major League Soccer club Inter Miami and the Argentina national team. Widely regarded as one of the greatest players of all time, Messi has won a record seven Ballon d'Or awards[note 2] and a record six European Golden Shoes, and in 2020 he was named to the Ballon d'Or Dream Team. Until leaving the club"
223
- input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
224
-
225
- outputs = model.generate(input_ids)
226
- print(tokenizer.decode(outputs[0]))
227
- ```
228
-
229
- </details>
230
-
231
- #### INT8
232
-
233
- <details>
234
- <summary> Click to expand </summary>
235
-
236
- ```python
237
- # pip install bitsandbytes accelerate
238
- from transformers import T5Tokenizer, T5ForConditionalGeneration
239
-
240
- tokenizer = T5Tokenizer.from_pretrained("mohamedemam/QA_GeneraToR")
241
- model = T5ForConditionalGeneration.from_pretrained("mohamedemam/QA_GeneraToR", device_map="auto", load_in_8bit=True)
242
-
243
- input_text = r"when: Lionel Andrés Messi[note 1] (Spanish pronunciation: [ljoˈnel anˈdɾes ˈmesi] (listen); born 24 June 1987), also known as Leo Messi, is an Argentine professional footballer who plays as a forward for and captains both Major League Soccer club Inter Miami and the Argentina national team. Widely regarded as one of the greatest players of all time, Messi has won a record seven Ballon d'Or awards[note 2] and a record six European Golden Shoes, and in 2020 he was named to the Ballon d'Or Dream Team. Until leaving the club"
244
- input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
245
-
246
- outputs = model.generate(input_ids)
247
- print(tokenizer.decode(outputs[0]))
248
- ```
249
-
250
- </details>
251
-
252
- # Uses
253
-
254
- ## Direct Use and Downstream Use
255
-
256
- The authors write in [the original paper's model card](https://arxiv.org/pdf/2210.11416.pdf) that:
257
-
258
- > The primary use is research on language models, including: research on zero-shot NLP tasks and in-context few-shot learning NLP tasks, such as reasoning, and question answering; advancing fairness and safety research, and understanding limitations of current large language models
259
-
260
- See the [research paper](https://arxiv.org/pdf/2210.11416.pdf) for further details.
261
-
262
- ## Out-of-Scope Use
263
-
264
- More information needed.
265
-
266
- # Bias, Risks, and Limitations
267
-
268
- The information below in this section are copied from the model's [official model card](https://arxiv.org/pdf/2210.11416.pdf):
269
-
270
- > Language models, including Flan-T5, can potentially be used for language generation in a harmful way, according to Rae et al. (2021). Flan-T5 should not be used directly in any application, without a prior assessment of safety and fairness concerns specific to the application.
271
-
272
- ## Ethical considerations and risks
273
-
274
- > Flan-T5 is fine-tuned on a large corpus of text data that was not filtered for explicit content or assessed for existing biases. As a result the model itself is potentially vulnerable to generating equivalently inappropriate content or replicating inherent biases in the underlying data.
275
-
276
- ## Known Limitations
277
-
278
- > Flan-T5 has not been tested in real world applications.
279
-
280
- ## Sensitive Use:
281
-
282
- > Flan-T5 should not be applied for any unacceptable use cases, e.g., generation of abusive speech.
283
-
284
- # Training Details
285
-
286
- ## Training Data
287
-
288
- The model was trained on a mixture of tasks, that includes the tasks described in the table below (from the original paper, figure 2):
289
-
290
- ![table.png](https://s3.amazonaws.com/moonup/production/uploads/1666363265279-62441d1d9fdefb55a0b7d12c.png)
291
-
292
-
293
- ## Training Procedure
294
-
295
- According to the model card from the [original paper](https://arxiv.org/pdf/2210.11416.pdf):
296
-
297
- > These models are based on pretrained T5 (Raffel et al., 2020) and fine-tuned with instructions for better zero-shot and few-shot performance. There is one fine-tuned Flan model per T5 model size.
298
-
299
- The model has been trained on TPU v3 or TPU v4 pods, using [`t5x`](https://github.com/google-research/t5x) codebase together with [`jax`](https://github.com/google/jax).
300
-
301
-
302
- # Evaluation
303
-
304
- ## Testing Data, Factors & Metrics
305
-
306
- The authors evaluated the model on various tasks covering several languages (1836 in total). See the table below for some quantitative evaluation:
307
- ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1668072995230-62441d1d9fdefb55a0b7d12c.png)
308
- For full details, please check the [research paper](https://arxiv.org/pdf/2210.11416.pdf).
309
-
310
- ## Results
311
-
312
- For full results for FLAN-T5-Large, see the [research paper](https://arxiv.org/pdf/2210.11416.pdf), Table 3.
313
-
314
- # Environmental Impact
315
-
316
- 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).
317
-
318
- - **Hardware Type:** Google Cloud TPU Pods - TPU v3 or TPU v4 | Number of chips ≥ 4.
319
- - **Hours used:** More information needed
320
- - **Cloud Provider:** GCP
321
- - **Compute Region:** More information needed
322
- - **Carbon Emitted:** More information needed
323
-
324
- # Citation
325
-
326
- **BibTeX:**
327
-
328
- ```bibtex
329
- @misc{https://doi.org/10.48550/arxiv.2210.11416,
330
- doi = {10.48550/ARXIV.2210.11416},
331
-
332
- url = {https://arxiv.org/abs/2210.11416},
333
-
334
- author = {Chung, Hyung Won and Hou, Le and Longpre, Shayne and Zoph, Barret and Tay, Yi and Fedus, William and Li, Eric and Wang, Xuezhi and Dehghani, Mostafa and Brahma, Siddhartha and Webson, Albert and Gu, Shixiang Shane and Dai, Zhuyun and Suzgun, Mirac and Chen, Xinyun and Chowdhery, Aakanksha and Narang, Sharan and Mishra, Gaurav and Yu, Adams and Zhao, Vincent and Huang, Yanping and Dai, Andrew and Yu, Hongkun and Petrov, Slav and Chi, Ed H. and Dean, Jeff and Devlin, Jacob and Roberts, Adam and Zhou, Denny and Le, Quoc V. and Wei, Jason},
335
-
336
- keywords = {Machine Learning (cs.LG), Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
337
-
338
- title = {Scaling Instruction-Finetuned Language Models},
339
-
340
- publisher = {arXiv},
341
-
342
- year = {2022},
343
-
344
- copyright = {Creative Commons Attribution 4.0 International}
345
- }
346
- ```
 
107
  ---
108
 
109
  # Model Card for QA_GeneraToR
110
+ Excited 😄 to share with you my very first model 🤖 for generating question-answering datasets! This incredible model takes articles 📜 or web pages, and all you need to provide is a prompt and context. It works like magic ✨, generating both the question and the answer. The prompt can be anything – "what," "who," "where" ... etc ! 😅
111
 
112
+ I've harnessed the power of the flan-t5 model 🚀, which has truly elevated the quality of the results. You can find all the code and details in the repository right here: https://lnkd.in/dhE5s_qg
113
+
114
+ And guess what? I've even deployed the project, so you can experience the magic firsthand: https://lnkd.in/diq-d3bt ❤️
115
+
116
+ Join me on this exciting journey into #nlp, #textgeneration, #t5, #deeplearning, and #huggingface. Your feedback and collaboration are more than welcome! 🌟
117
  # my fine tuned model
118
  >This model is fine tuned to generate a question with answers from a context , why that can be very usful this can help you to generate a dataset from a book article any thing you would to make from it dataset and train another model on this dataset , give the model any context with pre prometed of quation you want + context and it will extarct question + answer for you
119
  this are promted i use
 
129
  <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/flan2_architecture.jpg"
130
  alt="drawing" width="600"/>
131