Instructions to use crumb/gpt2023 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use crumb/gpt2023 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="crumb/gpt2023")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("crumb/gpt2023") model = AutoModelForCausalLM.from_pretrained("crumb/gpt2023") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use crumb/gpt2023 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "crumb/gpt2023" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "crumb/gpt2023", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/crumb/gpt2023
- SGLang
How to use crumb/gpt2023 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 "crumb/gpt2023" \ --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": "crumb/gpt2023", "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 "crumb/gpt2023" \ --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": "crumb/gpt2023", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use crumb/gpt2023 with Docker Model Runner:
docker model run hf.co/crumb/gpt2023
Update README.md
Browse files
README.md
CHANGED
|
@@ -30,6 +30,35 @@ The resulting model achieves a puplexity of 339.38, making it competative with C
|
|
| 30 |
|
| 31 |
(metric explanation here: https://twitter.com/aicrumb/status/1650350363898265601 , tldr it's a joke)
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
### Model description
|
| 35 |
|
|
|
|
| 30 |
|
| 31 |
(metric explanation here: https://twitter.com/aicrumb/status/1650350363898265601 , tldr it's a joke)
|
| 32 |
|
| 33 |
+
To demonstrate how GPT2(023) is aware of recent events, let’s take a look at a given example:
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
# About Covid-19
|
| 37 |
+
- -
|
| 38 |
+
The Covid-19
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
The model completes the text as:
|
| 42 |
+
|
| 43 |
+
```
|
| 44 |
+
# About Covid-19
|
| 45 |
+
- -
|
| 46 |
+
The Covid-19 pandemic is the worldwide pandemic that has left thousands of people unable to enter and work in or continue their normal daily normal life. In this brief post, we examine three of the main factors that have accelerated the pandemic and predict the path the pandemic will take through the rest of the world.
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
As you can see, GPT2(023) can generate coherent and relevant text pertaining to the Covid-19 pandemic, showcasing its ability to understand recent events. However, it struggles with certain subjects that weren’t extremely relevant in it’s training data. As only 2.23 billion tokens were used during finetuning, the model may have missed out on many recent events. One of those events being the latest US election.
|
| 50 |
+
|
| 51 |
+
Given text in a question and answer format:
|
| 52 |
+
|
| 53 |
+
```
|
| 54 |
+
Q: Who is the last president?
|
| 55 |
+
A: Donald Trump
|
| 56 |
+
|
| 57 |
+
Q: Who is the most recent president?
|
| 58 |
+
A:
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
The model completes the text with: `Barack Obama`
|
| 62 |
|
| 63 |
### Model description
|
| 64 |
|