Instructions to use josu/gpt-neo-pt-br with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use josu/gpt-neo-pt-br with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="josu/gpt-neo-pt-br")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("josu/gpt-neo-pt-br") model = AutoModelForCausalLM.from_pretrained("josu/gpt-neo-pt-br", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use josu/gpt-neo-pt-br with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "josu/gpt-neo-pt-br" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josu/gpt-neo-pt-br", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/josu/gpt-neo-pt-br
- SGLang
How to use josu/gpt-neo-pt-br 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 "josu/gpt-neo-pt-br" \ --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": "josu/gpt-neo-pt-br", "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 "josu/gpt-neo-pt-br" \ --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": "josu/gpt-neo-pt-br", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use josu/gpt-neo-pt-br with Docker Model Runner:
docker model run hf.co/josu/gpt-neo-pt-br
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("josu/gpt-neo-pt-br")
tokenizer = AutoTokenizer.from_pretrained("josu/gpt-neo-pt-br")
from transformers import pipeline
generator = pipeline('text-generation', model='josu/gpt-neo-pt-br')
generator("Futebol é o esporte,", max_length=30, num_return_sequences=1)
[{'generated_text': 'Futebol é o esporte, sendo que o país é um dos esportes mais populares do mundo. A seleção nacional de futebol do país é o mais popular e'}]
- Downloads last month
- 6