Instructions to use monilouise/opt125M_portuguese with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use monilouise/opt125M_portuguese with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="monilouise/opt125M_portuguese")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("monilouise/opt125M_portuguese") model = AutoModelForCausalLM.from_pretrained("monilouise/opt125M_portuguese", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use monilouise/opt125M_portuguese with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "monilouise/opt125M_portuguese" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "monilouise/opt125M_portuguese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/monilouise/opt125M_portuguese
- SGLang
How to use monilouise/opt125M_portuguese 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 "monilouise/opt125M_portuguese" \ --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": "monilouise/opt125M_portuguese", "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 "monilouise/opt125M_portuguese" \ --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": "monilouise/opt125M_portuguese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use monilouise/opt125M_portuguese with Docker Model Runner:
docker model run hf.co/monilouise/opt125M_portuguese
Model Card for Model ID
A Portuguese language model trained on https://huggingface.co/facebook/opt-125m .
Model Details
Model Description
- Developed by: Monique Monteiro
- Shared by [optional]: Monique Monteiro
- Model type: OPT
- Language(s) (NLP): Portuguese
- License: [More Information Needed]
- Finetuned from model [optional]: facebook/opt-125m
Use the code below to get started with the model.
generator = pipeline('text-generation', 'monilouise/opt125M_portuguese')
output = generator("Era uma vez", max_length=50, do_sample=True)
Training Details
Training Data
The model was trained on gs://unicamp-dl/ia025a_2022s1/aula9/sample-1gb.txt
Training Procedure
The model was trained for 3 epochs, by using learning rate = 5e-5 (linear scheduler).
Preprocessing [optional]
All text was tokenized and broken into chunks of 1024 tokens.
Training Hyperparameters
- Training regime: fp16 mixed precision
Speeds, Sizes, Times [optional]
Training time: 17 hours
Evaluation
The model was evaluated on a 5% validation split.
Metrics
Perplexity = 7.94.
Model Card Authors [optional]
Model Card Contact
- Downloads last month
- 10