Instructions to use ClassCat/gpt2-base-spanish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ClassCat/gpt2-base-spanish with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ClassCat/gpt2-base-spanish")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ClassCat/gpt2-base-spanish") model = AutoModelForCausalLM.from_pretrained("ClassCat/gpt2-base-spanish", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ClassCat/gpt2-base-spanish with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ClassCat/gpt2-base-spanish" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ClassCat/gpt2-base-spanish", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ClassCat/gpt2-base-spanish
- SGLang
How to use ClassCat/gpt2-base-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 "ClassCat/gpt2-base-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": "ClassCat/gpt2-base-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 "ClassCat/gpt2-base-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": "ClassCat/gpt2-base-spanish", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ClassCat/gpt2-base-spanish with Docker Model Runner:
docker model run hf.co/ClassCat/gpt2-base-spanish
Commit History
-
Update README.md
576853f
-
add model
a895d18 -
add model
1df0915 -
add model
5e050fd
-
add model
427ef91 -
add model
2139d51 -
add model
17d63ff -
add model
949b0a2
-
add model
0335877 -
add model
0d6874f -
add model
00f7a8d -
add model
3effe11 -
add model
6419d35
-
add model
87b8e54 -
add model
848a78f
-
add model
fbbc477 -
add model
c659e6e -
add model
5ad835a -
add model
c7d2965 -
add model
9388df9
-
add model
1839e9f -
add model
fca845c -
Update README.md
a368de8 -
add model
84edd4e -
Update README.md
7b09a7f
-
add model
6382f68 -
add model
515e30f
-
add model
c0117cd -
add model
c459bc3 -
Update README.md
591f579 -
add model
8533bc3 -
add model
192776e
-
add model
0f0374c -
Update README.md
af9d797 -
Create README.md
17bcdda -
add tokenizer
037d0db -
add model
7763297 -
initial commit
3b6bb35