rhaymison commited on
Commit
96a4b39
·
verified ·
1 Parent(s): 1c91e6b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +69 -182
README.md CHANGED
@@ -2,16 +2,8 @@
2
  library_name: transformers
3
  tags: []
4
  pipeline_tag: text-generation
5
- inference:
6
- parameters:
7
- do_sample: true
8
- repetition_penalty: 1.0
9
- top_k: 50
10
- top_p: 0.95
11
- temperature: 0.2
12
- num_return_sequences: 1
13
  widget:
14
- - text: Me conte sobra a ida do homem a Lua.
15
  example_title: Homem na Lua.
16
  - text: Fale sobre uma curiosidade sobre a história do mundo
17
  example_title: História.
@@ -19,199 +11,94 @@ widget:
19
  example_title: Escreva um poema.
20
  ---
21
 
22
- # Model Card for Model ID
23
 
24
- <!-- Provide a quick summary of what the model is/does. -->
 
 
 
25
 
 
26
 
27
 
28
- ## Model Details
 
 
29
 
30
- ### Model Description
31
 
32
- <!-- Provide a longer summary of what this model is. -->
 
 
 
 
 
 
33
 
34
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- - **Developed by:** [More Information Needed]
37
- - **Funded by [optional]:** [More Information Needed]
38
- - **Shared by [optional]:** [More Information Needed]
39
- - **Model type:** [More Information Needed]
40
- - **Language(s) (NLP):** [More Information Needed]
41
- - **License:** [More Information Needed]
42
- - **Finetuned from model [optional]:** [More Information Needed]
43
 
44
- ### Model Sources [optional]
45
 
46
- <!-- Provide the basic links for the model. -->
 
47
 
48
- - **Repository:** [More Information Needed]
49
- - **Paper [optional]:** [More Information Needed]
50
- - **Demo [optional]:** [More Information Needed]
 
 
 
 
51
 
52
- ## Uses
53
 
54
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
 
 
 
55
 
56
- ### Direct Use
57
 
58
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
59
 
60
- [More Information Needed]
61
 
62
- ### Downstream Use [optional]
 
63
 
64
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
 
 
65
 
66
- [More Information Needed]
67
 
68
- ### Out-of-Scope Use
69
 
70
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
71
-
72
- [More Information Needed]
73
-
74
- ## Bias, Risks, and Limitations
75
-
76
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
77
-
78
- [More Information Needed]
79
-
80
- ### Recommendations
81
-
82
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
83
-
84
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
85
-
86
- ## How to Get Started with the Model
87
-
88
- Use the code below to get started with the model.
89
-
90
- [More Information Needed]
91
-
92
- ## Training Details
93
-
94
- ### Training Data
95
-
96
- <!-- 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. -->
97
-
98
- [More Information Needed]
99
-
100
- ### Training Procedure
101
-
102
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
103
-
104
- #### Preprocessing [optional]
105
-
106
- [More Information Needed]
107
-
108
-
109
- #### Training Hyperparameters
110
-
111
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
112
-
113
- #### Speeds, Sizes, Times [optional]
114
-
115
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
116
-
117
- [More Information Needed]
118
-
119
- ## Evaluation
120
-
121
- <!-- This section describes the evaluation protocols and provides the results. -->
122
-
123
- ### Testing Data, Factors & Metrics
124
-
125
- #### Testing Data
126
-
127
- <!-- This should link to a Dataset Card if possible. -->
128
-
129
- [More Information Needed]
130
-
131
- #### Factors
132
-
133
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
134
-
135
- [More Information Needed]
136
-
137
- #### Metrics
138
-
139
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
140
-
141
- [More Information Needed]
142
-
143
- ### Results
144
-
145
- [More Information Needed]
146
-
147
- #### Summary
148
-
149
-
150
-
151
- ## Model Examination [optional]
152
-
153
- <!-- Relevant interpretability work for the model goes here -->
154
-
155
- [More Information Needed]
156
-
157
- ## Environmental Impact
158
-
159
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
160
-
161
- 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).
162
-
163
- - **Hardware Type:** [More Information Needed]
164
- - **Hours used:** [More Information Needed]
165
- - **Cloud Provider:** [More Information Needed]
166
- - **Compute Region:** [More Information Needed]
167
- - **Carbon Emitted:** [More Information Needed]
168
-
169
- ## Technical Specifications [optional]
170
-
171
- ### Model Architecture and Objective
172
-
173
- [More Information Needed]
174
-
175
- ### Compute Infrastructure
176
-
177
- [More Information Needed]
178
-
179
- #### Hardware
180
-
181
- [More Information Needed]
182
-
183
- #### Software
184
-
185
- [More Information Needed]
186
-
187
- ## Citation [optional]
188
-
189
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
190
-
191
- **BibTeX:**
192
-
193
- [More Information Needed]
194
-
195
- **APA:**
196
-
197
- [More Information Needed]
198
-
199
- ## Glossary [optional]
200
-
201
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
202
-
203
- [More Information Needed]
204
-
205
- ## More Information [optional]
206
-
207
- [More Information Needed]
208
-
209
- ## Model Card Authors [optional]
210
-
211
- [More Information Needed]
212
-
213
- ## Model Card Contact
214
-
215
- [More Information Needed]
216
 
 
 
 
 
 
 
 
 
217
 
 
2
  library_name: transformers
3
  tags: []
4
  pipeline_tag: text-generation
 
 
 
 
 
 
 
 
5
  widget:
6
+ - text: Me conte sobre a ida do homem a Lua.
7
  example_title: Homem na Lua.
8
  - text: Fale sobre uma curiosidade sobre a história do mundo
9
  example_title: História.
 
11
  example_title: Escreva um poema.
12
  ---
13
 
 
14
 
15
+ ## Model description
16
+ The Cuscuz-com-gemma 2b is a model derived from a fine tuning of the google/gemma-2b-it. This model was tuned to be specialized in the Northeast region of Brazil.
17
+ The model was specialized in a dataset that covered historical, geographical, economic, cultural and culinary issues in the northeast region.
18
+ To make better use of the Cuscuz, the ideal is to use the model without quantization. This model is a small version of Cuscuz-7b whit another arquiteture
19
 
20
+ ## How to Use
21
 
22
 
23
+ ```python
24
+ from transformers import AutoTokenizer, pipeline
25
+ import torch
26
 
27
+ model = "rhaymison/cuscuz-com-gemma-2b"
28
 
29
+ tokenizer = AutoTokenizer.from_pretrained(model)
30
+ pipeline = pipeline(
31
+ "text-generation",
32
+ model=model,
33
+ model_kwargs={"torch_dtype": torch.bfloat16},
34
+ device="cuda",
35
+ )
36
 
37
+ messages = [
38
+ {"role": "user", "content": "Me conte sobre o estado de Sergipe."},
39
+ ]
40
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
41
+ outputs = pipeline(
42
+ prompt,
43
+ max_new_tokens=256,
44
+ do_sample=True,
45
+ temperature=0.7,
46
+ top_k=50,
47
+ top_p=0.95
48
+ )
49
+ print(outputs[0]["generated_text"][len(prompt):].replace("model",""))
50
 
51
+ #Sergipe é o menor estado do Nordeste brasileiro em extensão territorial.
52
+ #O estado de Sergipe é conhecido por suas praias, sua culinária à base de frutos do mar e sua importância histórica na produção de açúcar.
53
+ #Sergipe teve papel fundamental na produção de açúcar no Brasil colonial, sendo uma das regiões onde se concentraram os engenhos de açúcar.
54
+ ```
 
 
 
55
 
 
56
 
57
+ ```python
58
+ from transformers import AutoTokenizer, AutoModelForCausalLM
59
 
60
+ tokenizer2 = AutoTokenizer.from_pretrained("cuscuz-com-gemma-2b")
61
+ model2 = AutoModelForCausalLM.from_pretrained("cuscuz-com-gemma-2b", device_map={"":0})
62
+ tokenizer2.pad_token = tokenizer2.eos_token
63
+ tokenizer2.add_eos_token = True
64
+ tokenizer2.add_bos_token, tokenizer2.add_eos_token
65
+ tokenizer2.padding_side = "right"
66
+ ```
67
 
68
+ ```python
69
 
70
+ text = f"""
71
+ Você é um assistente especialista em história do Nordeste Brasileiro.
72
+ Você sempre responde de forma clara e educada e sempre com informações
73
+ verdadeiras. Responda com detalhes e riquesas de informação
74
+ <start_of_turn>Me conte sobre o Folclore Nordestino?<end_of_turn>
75
+ <start_of_turn>model"""
76
 
77
+ device = "cuda:0"
78
 
79
+ inputs = tokenizer2(text, return_tensors="pt").to(device)
80
 
81
+ outputs = model2.generate(**inputs, max_new_tokens=100, do_sample=False)
82
 
83
+ output = tokenizer2.decode(outputs[0], skip_special_tokens=True, skip_prompt=True)
84
+ print(output.replace("model"," "))
85
 
86
+ #O Folclore Nordestino é uma parte importante da nossa cultura, com manifestações como o bumba meu boi, o reisado, o maracatu e o repente.
87
+ #Essa história é rica em lendas, contarorias e tradições que são passadas de geração em geração.
88
+ ```
89
 
90
+ ### Comments
91
 
92
+ Any idea, help or report will always be welcome.
93
 
94
+ email: rhaymisoncristian@gmail.com
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
+ <div style="display:flex; flex-direction:row; justify-content:left">
97
+ <a href="https://www.linkedin.com/in/heleno-betini-2b3016175/" target="_blank">
98
+ <img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white">
99
+ </a>
100
+ <a href="https://github.com/rhaymisonbetini" target="_blank">
101
+ <img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white">
102
+ </a>
103
+ </div>
104