Text Generation
Transformers
PyTorch
TensorFlow
JAX
LiteRT
Rust
ONNX
Safetensors
English
gpt2
pyTtorch
tensorflow
text-generation-inference
Instructions to use papahawk/gpt2-1.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use papahawk/gpt2-1.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="papahawk/gpt2-1.5b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("papahawk/gpt2-1.5b") model = AutoModelForCausalLM.from_pretrained("papahawk/gpt2-1.5b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use papahawk/gpt2-1.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "papahawk/gpt2-1.5b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "papahawk/gpt2-1.5b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/papahawk/gpt2-1.5b
- SGLang
How to use papahawk/gpt2-1.5b 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 "papahawk/gpt2-1.5b" \ --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": "papahawk/gpt2-1.5b", "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 "papahawk/gpt2-1.5b" \ --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": "papahawk/gpt2-1.5b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use papahawk/gpt2-1.5b with Docker Model Runner:
docker model run hf.co/papahawk/gpt2-1.5b
Update README.md
Browse filesAll credits and gratitude to OpenAI and the many developers who cleared the path #!
README.md
CHANGED
|
@@ -1,3 +1,74 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- text-generation
|
| 6 |
+
- pyTtorch
|
| 7 |
+
- tensorflow
|
| 8 |
+
- transformers
|
| 9 |
+
datasets:
|
| 10 |
+
- gpt-2-output-dataset
|
| 11 |
+
license: mit
|
| 12 |
---
|
| 13 |
+
|
| 14 |
+
<h1 style='text-align: center '>GPT2-1.5b LLM</h1>
|
| 15 |
+
<h2 style='text-align: center '><em>Fork of OpenAI/GPT2-1.5b</em> </h2>
|
| 16 |
+
<h3 style='text-align: center '>Model Card</h3>
|
| 17 |
+
<img src="https://alt-web.xyz/images/rainbow.png" alt="Rainbow Solutions" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
| 18 |
+
|
| 19 |
+
# gpt2-1.5b
|
| 20 |
+
|
| 21 |
+
Code and models from the paper ["Language Models are Unsupervised Multitask Learners"](https://d4mucfpksywv.cloudfront.net/better-language-models/language-models.pdf).
|
| 22 |
+
|
| 23 |
+
You can read about GPT-2 and its staged release in our [original blog post](https://blog.openai.com/better-language-models/), [6 month follow-up post](https://openai.com/blog/gpt-2-6-month-follow-up/), and [final post](https://www.openai.com/blog/gpt-2-1-5b-release/).
|
| 24 |
+
|
| 25 |
+
We have also [released a dataset](https://github.com/openai/gpt-2-output-dataset) for researchers to study their behaviors.
|
| 26 |
+
|
| 27 |
+
<sup>*</sup> *Note that our original parameter counts were wrong due to an error (in our previous blog posts and paper). Thus you may have seen small referred to as 117M and medium referred to as 345M.*
|
| 28 |
+
|
| 29 |
+
## Usage
|
| 30 |
+
|
| 31 |
+
This repository is meant to be a starting point for researchers and engineers to experiment with GPT-2.
|
| 32 |
+
|
| 33 |
+
For basic information, see our [model card](./model_card.md).
|
| 34 |
+
|
| 35 |
+
### Some caveats
|
| 36 |
+
|
| 37 |
+
- GPT-2 models' robustness and worst case behaviors are not well-understood. As with any machine-learned model, carefully evaluate GPT-2 for your use case, especially if used without fine-tuning or in safety-critical applications where reliability is important.
|
| 38 |
+
- The dataset our GPT-2 models were trained on contains many texts with [biases](https://twitter.com/TomerUllman/status/1101485289720242177) and factual inaccuracies, and thus GPT-2 models are likely to be biased and inaccurate as well.
|
| 39 |
+
- To avoid having samples mistaken as human-written, we recommend clearly labeling samples as synthetic before wide dissemination. Our models are often incoherent or inaccurate in subtle ways, which takes more than a quick read for a human to notice.
|
| 40 |
+
|
| 41 |
+
### Work with us
|
| 42 |
+
|
| 43 |
+
Please [let us know](mailto:languagequestions@openai.com) if you’re doing interesting research with or working on applications of GPT-2! We’re especially interested in hearing from and potentially working with those who are studying
|
| 44 |
+
- Potential malicious use cases and defenses against them (e.g. the detectability of synthetic text)
|
| 45 |
+
- The extent of problematic content (e.g. bias) being baked into the models and effective mitigations
|
| 46 |
+
|
| 47 |
+
## Development
|
| 48 |
+
|
| 49 |
+
See [DEVELOPERS.md](./DEVELOPERS.md)
|
| 50 |
+
|
| 51 |
+
## Contributors
|
| 52 |
+
|
| 53 |
+
See [CONTRIBUTORS.md](./CONTRIBUTORS.md)
|
| 54 |
+
|
| 55 |
+
## Citation
|
| 56 |
+
|
| 57 |
+
Please use the following bibtex entry:
|
| 58 |
+
```
|
| 59 |
+
@article{radford2019language,
|
| 60 |
+
title={Language Models are Unsupervised Multitask Learners},
|
| 61 |
+
author={Radford, Alec and Wu, Jeff and Child, Rewon and Luan, David and Amodei, Dario and Sutskever, Ilya},
|
| 62 |
+
year={2019}
|
| 63 |
+
}
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Future work
|
| 67 |
+
|
| 68 |
+
We may release code for evaluating the models on various benchmarks.
|
| 69 |
+
|
| 70 |
+
We are still considering release of the larger models.
|
| 71 |
+
|
| 72 |
+
## License
|
| 73 |
+
|
| 74 |
+
[Modified MIT](./LICENSE)
|