# Use a pipeline as a high-level helperfrom transformers import pipeline
messages = [
{"role": "system", "content": "Eres un modelo experto en poesía española."},
{"role": "user", "content": "Escribe un poema sobre la pérdida de un coche querido en forma de pareado."},
]
generate_kwargs = {
"do_sample": True,
"temperature": 0.7,
"max_new_tokens": 150,
}
pipe = pipeline("text-generation", model="bertin-project/Gromenauer-7B-Instruct", generate_kwargs=generate_kwargs)
pipe(messages)
Output:
<|system|>
Eres un modelo experto en poesía española.</s>
<|user|>
Escribe un poema sobre la pérdida de un coche querido en forma de pareado.</s>
<|assistant|>
Una mañana de invierno salí al sol peregrino,
y encontré mi auto cogiendo una lechuga en el camino.</s>
Contrastive search example:
messages = [
{"role": "system", "content": "Eres un asistente en español. Responde de manera exacta y concisa."},
{"role": "user", "content": "¿Por qué es famosa Sevilla?"},
]
generate_kwargs = {
"penalty_alpha": 0.6,
"max_new_tokens": 300,
}
pipe = pipeline("text-generation", model="bertin-project/Gromenauer-7B-Instruct", generate_kwargs=generate_kwargs)
pipe(messages)
Output:
<|system|>
Eres un asistente en español. Responde de manera exacta y concisa.</s>
<|user|>
¿Por qué es famosa Sevilla?</s>
<|assistant|>
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>
Gromenauer-7B-Instruct huggingface.co is an AI model on huggingface.co that provides Gromenauer-7B-Instruct's model effect (), which can be used instantly with this bertin-project Gromenauer-7B-Instruct model. huggingface.co supports a free trial of the Gromenauer-7B-Instruct model, and also provides paid use of the Gromenauer-7B-Instruct. Support call Gromenauer-7B-Instruct model through api, including Node.js, Python, http.
Gromenauer-7B-Instruct huggingface.co is an online trial and call api platform, which integrates Gromenauer-7B-Instruct's modeling effects, including api services, and provides a free online trial of Gromenauer-7B-Instruct, you can try Gromenauer-7B-Instruct online for free by clicking the link below.
bertin-project Gromenauer-7B-Instruct online free url in huggingface.co:
Gromenauer-7B-Instruct is an open source model from GitHub that offers a free installation service, and any user can find Gromenauer-7B-Instruct on GitHub to install. At the same time, huggingface.co provides the effect of Gromenauer-7B-Instruct install, users can directly use Gromenauer-7B-Instruct installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Gromenauer-7B-Instruct install url in huggingface.co: