Instructions to use datificate/gpt2-small-spanish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use datificate/gpt2-small-spanish with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="datificate/gpt2-small-spanish")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("datificate/gpt2-small-spanish") model = AutoModelForCausalLM.from_pretrained("datificate/gpt2-small-spanish", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use datificate/gpt2-small-spanish with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "datificate/gpt2-small-spanish" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "datificate/gpt2-small-spanish", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/datificate/gpt2-small-spanish
- SGLang
How to use datificate/gpt2-small-spanish with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "datificate/gpt2-small-spanish" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "datificate/gpt2-small-spanish", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "datificate/gpt2-small-spanish" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "datificate/gpt2-small-spanish", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use datificate/gpt2-small-spanish with Docker Model Runner:
docker model run hf.co/datificate/gpt2-small-spanish
Commit ·
6abafff
1
Parent(s): 3f08be3
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,7 +9,7 @@ datasets:
|
|
| 9 |
---
|
| 10 |
La descripción en Español se encuentra después de la descripción en Inglés.
|
| 11 |
|
| 12 |
-
# GPT-2 small spanish: a Language Model for Spanish text generation (and more NLP tasks...)
|
| 13 |
GPT-2 small spanish is a state-of-the-art language model for Spanish based on the GPT-2 small model.
|
| 14 |
|
| 15 |
It was trained on Spanish Wikipedia using **Transfer Learning and Fine-tuning techniques**. The training took around 70 hours of training with four GPU NVIDIA GTX 1080-Ti with 11GB of DDR5 and with around han 3GB of (processed) training data.
|
|
@@ -34,7 +34,7 @@ The training was possible thanks to the computing power of several GPUs (GPU NVI
|
|
| 34 |
As stated before, this work is mainly based in the work of [Pierre GUILLOU](https://www.linkedin.com/in/pierreguillou/).
|
| 35 |
|
| 36 |
|
| 37 |
-
# GPT-2 small spanish: un modelo de lenguaje para generación de texto en Español (y algunas otras tareas de NLP...)
|
| 38 |
|
| 39 |
GPT-2 small spanish es un modelo de lenguaje de vanguardia en Español basado en el modelo pequeño GPT-2.
|
| 40 |
|
|
@@ -55,7 +55,7 @@ La versión preliminar del modelo se encuentra en Hugging Face.
|
|
| 55 |
## Autores
|
| 56 |
|
| 57 |
El modelo fue entreando y evaluado por [Josué Obregon](https://www.linkedin.com/in/josue-obregon/) y [Berny Carrera](https://www.linkedin.com/in/bernycarrera/), fundadores de [Datificate](https://datificate.com), un espacio para aprender Machine Learning en Español.
|
| 58 |
-
El entrenamiento fue posible gracias al poder computacional de varias GPUs (GPU NVIDIA GTX1080-Ti)
|
| 59 |
|
| 60 |
Como fue mencionado anteriormente, este trabajo esta basado en el trabajo de [Pierre GUILLOU](https://www.linkedin.com/in/pierreguillou/).
|
| 61 |
|
|
|
|
| 9 |
---
|
| 10 |
La descripción en Español se encuentra después de la descripción en Inglés.
|
| 11 |
|
| 12 |
+
#(English) GPT-2 small spanish: a Language Model for Spanish text generation (and more NLP tasks...)
|
| 13 |
GPT-2 small spanish is a state-of-the-art language model for Spanish based on the GPT-2 small model.
|
| 14 |
|
| 15 |
It was trained on Spanish Wikipedia using **Transfer Learning and Fine-tuning techniques**. The training took around 70 hours of training with four GPU NVIDIA GTX 1080-Ti with 11GB of DDR5 and with around han 3GB of (processed) training data.
|
|
|
|
| 34 |
As stated before, this work is mainly based in the work of [Pierre GUILLOU](https://www.linkedin.com/in/pierreguillou/).
|
| 35 |
|
| 36 |
|
| 37 |
+
# (Español) GPT-2 small spanish: un modelo de lenguaje para generación de texto en Español (y algunas otras tareas de NLP...)
|
| 38 |
|
| 39 |
GPT-2 small spanish es un modelo de lenguaje de vanguardia en Español basado en el modelo pequeño GPT-2.
|
| 40 |
|
|
|
|
| 55 |
## Autores
|
| 56 |
|
| 57 |
El modelo fue entreando y evaluado por [Josué Obregon](https://www.linkedin.com/in/josue-obregon/) y [Berny Carrera](https://www.linkedin.com/in/bernycarrera/), fundadores de [Datificate](https://datificate.com), un espacio para aprender Machine Learning en Español.
|
| 58 |
+
El entrenamiento fue posible gracias al poder computacional de varias GPUs (GPU NVIDIA GTX1080-Ti) del Laboratorio de Inteligencia Artificial Industrial [IAI Lab](http://iai.khu.ac.kr/) (Universidad de Kyung Hee) al cual Josué pertenece como investigador Postdoctoral en Inteligencia Artificial Industrial.
|
| 59 |
|
| 60 |
Como fue mencionado anteriormente, este trabajo esta basado en el trabajo de [Pierre GUILLOU](https://www.linkedin.com/in/pierreguillou/).
|
| 61 |
|