Instructions to use readerbench/RoGPT2-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use readerbench/RoGPT2-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="readerbench/RoGPT2-medium")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("readerbench/RoGPT2-medium") model = AutoModelForCausalLM.from_pretrained("readerbench/RoGPT2-medium") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use readerbench/RoGPT2-medium with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "readerbench/RoGPT2-medium" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "readerbench/RoGPT2-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/readerbench/RoGPT2-medium
- SGLang
How to use readerbench/RoGPT2-medium 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 "readerbench/RoGPT2-medium" \ --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": "readerbench/RoGPT2-medium", "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 "readerbench/RoGPT2-medium" \ --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": "readerbench/RoGPT2-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use readerbench/RoGPT2-medium with Docker Model Runner:
docker model run hf.co/readerbench/RoGPT2-medium
ReaderBench commited on
Commit ·
f0587eb
1
Parent(s): fb77fbb
update readme
Browse files
README.md
CHANGED
|
@@ -52,7 +52,7 @@ print(tokenizer.decode(text[0]))
|
|
| 52 |
|
| 53 |
### Training Statistics
|
| 54 |
|
| 55 |
-
| Version | Number of parameters | Number of epoch | Duration of an epoch |
|
| 56 |
|:-------:|:--------------------:|:---------------:|:--------------------:|:----------:|:----------:|:---:|
|
| 57 |
| Base | 124M | 15 | 7h | 1024 | 72 | 22.96 |
|
| 58 |
| Medium | 354M | 10 | 22h | 1024 | 24 | 17.64 |
|
|
@@ -125,8 +125,8 @@ print(tokenizer.decode(text[0]))
|
|
| 125 |
|RoBERT-small | - | 30.84 | 45.17 |
|
| 126 |
|RoBERT-base | - | 53.52 | 70.04 |
|
| 127 |
|RoBERT-large | - | 55.46 | 69.64 |
|
| 128 |
-
|mBERT | - | 72.7 |
|
| 129 |
-
|XLM-R Large | - |**
|
| 130 |
|RoGPT2-base | Greedy | 23.69 | 35.97 |
|
| 131 |
|RoGPT2-base | Beam-search-4 | 24.11 | 35.27 |
|
| 132 |
|RoGPT2-medium | Greedy | 29.66 | 44.74 |
|
|
|
|
| 52 |
|
| 53 |
### Training Statistics
|
| 54 |
|
| 55 |
+
| Version | Number of parameters | Number of epoch | Duration of an epoch | Context size | Batch size | PPL |
|
| 56 |
|:-------:|:--------------------:|:---------------:|:--------------------:|:----------:|:----------:|:---:|
|
| 57 |
| Base | 124M | 15 | 7h | 1024 | 72 | 22.96 |
|
| 58 |
| Medium | 354M | 10 | 22h | 1024 | 24 | 17.64 |
|
|
|
|
| 125 |
|RoBERT-small | - | 30.84 | 45.17 |
|
| 126 |
|RoBERT-base | - | 53.52 | 70.04 |
|
| 127 |
|RoBERT-large | - | 55.46 | 69.64 |
|
| 128 |
+
|mBERT | - | 59.9 | 72.7 |
|
| 129 |
+
|XLM-R Large | - |**69.7** |**83.6** |
|
| 130 |
|RoGPT2-base | Greedy | 23.69 | 35.97 |
|
| 131 |
|RoGPT2-base | Beam-search-4 | 24.11 | 35.27 |
|
| 132 |
|RoGPT2-medium | Greedy | 29.66 | 44.74 |
|