Instructions to use cglez/gpt2-ohsumed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cglez/gpt2-ohsumed with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cglez/gpt2-ohsumed")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cglez/gpt2-ohsumed") model = AutoModelForCausalLM.from_pretrained("cglez/gpt2-ohsumed", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cglez/gpt2-ohsumed with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cglez/gpt2-ohsumed" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cglez/gpt2-ohsumed", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cglez/gpt2-ohsumed
- SGLang
How to use cglez/gpt2-ohsumed 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 "cglez/gpt2-ohsumed" \ --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": "cglez/gpt2-ohsumed", "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 "cglez/gpt2-ohsumed" \ --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": "cglez/gpt2-ohsumed", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cglez/gpt2-ohsumed with Docker Model Runner:
docker model run hf.co/cglez/gpt2-ohsumed
Initial commit
Browse files
README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
language: en
|
| 4 |
+
license: mit
|
| 5 |
+
datasets: []
|
| 6 |
+
tags: []
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Model Card for <Model>
|
| 10 |
+
|
| 11 |
+
A pretrained GPT2 using <Dataset>.
|
| 12 |
+
|
| 13 |
+
## Model Details
|
| 14 |
+
|
| 15 |
+
### Model Description
|
| 16 |
+
|
| 17 |
+
A pretrained GPT2 using <Dataset>.
|
| 18 |
+
|
| 19 |
+
- **Developed by:** [Cesar Gonzalez-Gutierrez](https://ceguel.es)
|
| 20 |
+
- **Funded by:** [ERC](https://erc.europa.eu)
|
| 21 |
+
- **Model type:** pretrained GPT2
|
| 22 |
+
- **Language(s) (NLP):** English
|
| 23 |
+
- **License:** MIT
|
| 24 |
+
- **Pretrained from model:** [GPT2](https://huggingface.co/openai-community/gpt2)
|
| 25 |
+
|
| 26 |
+
### Model Checkpoints
|
| 27 |
+
|
| 28 |
+
[More Information Needed]
|
| 29 |
+
|
| 30 |
+
### Model Sources
|
| 31 |
+
|
| 32 |
+
- **Paper:** [More Information Needed]
|
| 33 |
+
|
| 34 |
+
## Intended Uses & Limitations
|
| 35 |
+
|
| 36 |
+
See <https://huggingface.co/openai-community/gpt2#intended-uses--limitations>.
|
| 37 |
+
|
| 38 |
+
### Loading Checkpoints
|
| 39 |
+
|
| 40 |
+
[More Information Needed]
|
| 41 |
+
|
| 42 |
+
## Training Details
|
| 43 |
+
|
| 44 |
+
### Training Data
|
| 45 |
+
|
| 46 |
+
[More Information Needed]
|
| 47 |
+
|
| 48 |
+
#### Preprocessing [optional]
|
| 49 |
+
|
| 50 |
+
[More Information Needed]
|
| 51 |
+
|
| 52 |
+
#### Training Hyperparameters
|
| 53 |
+
|
| 54 |
+
- **Training regime:** fp16
|
| 55 |
+
- **Batch size:** 8
|
| 56 |
+
- **Gradient accumulation steps:** 12
|
| 57 |
+
|
| 58 |
+
## Environmental Impact
|
| 59 |
+
|
| 60 |
+
- **Hardware Type:** NVIDIA A100 PCIE 40GB
|
| 61 |
+
- **Hours used:** [More Information Needed]
|
| 62 |
+
- **Cluster Provider:** [Artemisa](https://artemisa.ific.uv.es/web/)
|
| 63 |
+
- **Compute Region:** EU
|
| 64 |
+
- **Carbon Emitted:** [More Information Needed] <!-- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). -->
|
| 65 |
+
|
| 66 |
+
## Citation
|
| 67 |
+
|
| 68 |
+
**BibTeX:**
|
| 69 |
+
|
| 70 |
+
[More Information Needed]
|