Ruqiya commited on
Commit
6da139e
1 Parent(s): 9529f85

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -179
README.md CHANGED
@@ -18,190 +18,29 @@ It achieves the following results on the evaluation set:
18
 
19
 
20
 
21
- ## Model Details
22
-
23
- ### Model Description
24
-
25
- <!-- Provide a longer summary of what this model is. -->
26
-
27
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
28
-
29
- - **Developed by:** [More Information Needed]
30
- - **Funded by [optional]:** [More Information Needed]
31
- - **Shared by [optional]:** [More Information Needed]
32
- - **Model type:** [More Information Needed]
33
- - **Language(s) (NLP):** [More Information Needed]
34
- - **License:** [More Information Needed]
35
- - **Finetuned from model [optional]:** [More Information Needed]
36
-
37
- ### Model Sources [optional]
38
-
39
- <!-- Provide the basic links for the model. -->
40
-
41
- - **Repository:** [More Information Needed]
42
- - **Paper [optional]:** [More Information Needed]
43
- - **Demo [optional]:** [More Information Needed]
44
-
45
- ## Uses
46
-
47
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
48
-
49
  ### Direct Use
50
 
51
  <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
52
 
53
- [More Information Needed]
54
-
55
- ### Downstream Use [optional]
56
-
57
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
58
-
59
- [More Information Needed]
60
-
61
- ### Out-of-Scope Use
62
-
63
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
64
-
65
- [More Information Needed]
66
-
67
- ## Bias, Risks, and Limitations
68
-
69
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
70
-
71
- [More Information Needed]
72
-
73
- ### Recommendations
74
-
75
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
76
-
77
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
78
-
79
- ## How to Get Started with the Model
80
-
81
- Use the code below to get started with the model.
82
-
83
- [More Information Needed]
84
-
85
- ## Training Details
86
-
87
- ### Training Data
88
-
89
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
90
-
91
- [More Information Needed]
92
-
93
- ### Training Procedure
94
-
95
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
96
-
97
- #### Preprocessing [optional]
98
-
99
- [More Information Needed]
100
-
101
-
102
- #### Training Hyperparameters
103
-
104
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
105
-
106
- #### Speeds, Sizes, Times [optional]
107
-
108
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
109
-
110
- [More Information Needed]
111
-
112
- ## Evaluation
113
-
114
- <!-- This section describes the evaluation protocols and provides the results. -->
115
-
116
- ### Testing Data, Factors & Metrics
117
-
118
- #### Testing Data
119
-
120
- <!-- This should link to a Dataset Card if possible. -->
121
-
122
- [More Information Needed]
123
-
124
- #### Factors
125
-
126
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
127
-
128
- [More Information Needed]
129
-
130
- #### Metrics
131
-
132
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
133
-
134
- [More Information Needed]
135
-
136
- ### Results
137
-
138
- [More Information Needed]
139
-
140
- #### Summary
141
-
142
-
143
-
144
- ## Model Examination [optional]
145
-
146
- <!-- Relevant interpretability work for the model goes here -->
147
-
148
- [More Information Needed]
149
-
150
- ## Environmental Impact
151
-
152
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
153
-
154
-
155
- - **Hardware Type:** [More Information Needed]
156
- - **Hours used:** [More Information Needed]
157
- - **Cloud Provider:** [More Information Needed]
158
- - **Compute Region:** [More Information Needed]
159
- - **Carbon Emitted:** [More Information Needed]
160
-
161
- ## Technical Specifications [optional]
162
-
163
- ### Model Architecture and Objective
164
-
165
- [More Information Needed]
166
-
167
- ### Compute Infrastructure
168
-
169
- [More Information Needed]
170
-
171
- #### Hardware
172
-
173
- [More Information Needed]
174
-
175
- #### Software
176
-
177
- [More Information Needed]
178
-
179
- ## Citation [optional]
180
-
181
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
182
-
183
- **BibTeX:**
184
-
185
- [More Information Needed]
186
-
187
- **APA:**
188
-
189
- [More Information Needed]
190
-
191
- ## Glossary [optional]
192
-
193
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
194
-
195
- [More Information Needed]
196
-
197
- ## More Information [optional]
198
-
199
- [More Information Needed]
200
 
201
- ## Model Card Authors [optional]
 
202
 
203
- [More Information Needed]
 
 
 
 
 
 
 
204
 
205
- ## Model Card Contact
 
 
206
 
207
- [More Information Needed]
 
18
 
19
 
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ### Direct Use
22
 
23
  <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
24
+ ```
25
+ !pip install -qU transformers accelerate
26
 
27
+ from transformers import AutoTokenizer
28
+ import transformers
29
+ import torch
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ model = "Ruqiya/Fine-Tuning-Gemma-2b-it-for-Arabic"
32
+ messages = [{"role": "user", "content": "ما هو الذكاء الاصطناعي؟"}]
33
 
34
+ tokenizer = AutoTokenizer.from_pretrained(model)
35
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
36
+ pipeline = transformers.pipeline(
37
+ "text-generation",
38
+ model=model,
39
+ torch_dtype=torch.float16,
40
+ device_map="auto",
41
+ )
42
 
43
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
44
+ print(outputs[0]["generated_text"])
45
+ ```
46