alvp commited on
Commit
b3f4db6
1 Parent(s): 7252620

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -18,6 +18,8 @@ pipeline_tag: text-generation
18
  Gromenauer-7B-Instruct is an instruct fine-tuned version of the [bertin-project/Gromenauer-7B](https://huggingface.co/bertin-project/Gromenauer-7B) model using the [bertin-project/bonanza-hf](https://huggingface.co/datasets/bertin-project/bonanza-hf) and [bertin-project/zenobia-instruct-hf](https://huggingface.co/datasets/bertin-project/zenobia-instruct-hf) datasets.
19
 
20
  ## Usage examples
 
 
21
  ```python
22
  # Use a pipeline as a high-level helper
23
  from transformers import pipeline
@@ -33,7 +35,7 @@ generate_kwargs = {
33
 
34
  "temperature": 0.7,
35
 
36
- "max_new_tokens": 35,
37
 
38
  }
39
 
@@ -51,6 +53,35 @@ Una mañana de invierno salí al sol peregrino,
51
  y encontré mi auto cogiendo una lechuga en el camino.</s>
52
  ```
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ## Model Details
55
 
56
  - **Model Type**: Mistral
 
18
  Gromenauer-7B-Instruct is an instruct fine-tuned version of the [bertin-project/Gromenauer-7B](https://huggingface.co/bertin-project/Gromenauer-7B) model using the [bertin-project/bonanza-hf](https://huggingface.co/datasets/bertin-project/bonanza-hf) and [bertin-project/zenobia-instruct-hf](https://huggingface.co/datasets/bertin-project/zenobia-instruct-hf) datasets.
19
 
20
  ## Usage examples
21
+
22
+ ### Multinomial sampling example:
23
  ```python
24
  # Use a pipeline as a high-level helper
25
  from transformers import pipeline
 
35
 
36
  "temperature": 0.7,
37
 
38
+ "max_new_tokens": 150,
39
 
40
  }
41
 
 
53
  y encontré mi auto cogiendo una lechuga en el camino.</s>
54
  ```
55
 
56
+ ### Contrastive search example:
57
+
58
+ ```python
59
+ messages = [
60
+ {"role": "system", "content": "Eres un asistente en español. Responde de manera exacta y concisa."},
61
+ {"role": "user", "content": "¿Por qué es famosa Sevilla?"},
62
+ ]
63
+
64
+ generate_kwargs = {
65
+
66
+ "penalty_alpha": 0.6,
67
+
68
+ "max_new_tokens": 300,
69
+
70
+ }
71
+ pipe = pipeline("text-generation", model="bertin-project/Gromenauer-7B-Instruct", generate_kwargs=generate_kwargs)
72
+ pipe(messages)
73
+ ```
74
+
75
+ Output:
76
+ ```
77
+ <|system|>
78
+ Eres un asistente en español. Responde de manera exacta y concisa.</s>
79
+ <|user|>
80
+ ¿Por qué es famosa Sevilla?</s>
81
+ <|assistant|>
82
+ Sevilla es conocida por su belleza arquitectónica, con edificios como la Giralda, el Alcázar y la Catedral, así como por sus fiestas populares como la Feria de Abril y Semana Santa. Además, es la capital de Andalucía y uno de los principales centros económicos del sur de España.</s>
83
+ ```
84
+
85
  ## Model Details
86
 
87
  - **Model Type**: Mistral