Instructions to use coderian/TinyGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use coderian/TinyGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="coderian/TinyGPT", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("coderian/TinyGPT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use coderian/TinyGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "coderian/TinyGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "coderian/TinyGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/coderian/TinyGPT
- SGLang
How to use coderian/TinyGPT 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 "coderian/TinyGPT" \ --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": "coderian/TinyGPT", "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 "coderian/TinyGPT" \ --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": "coderian/TinyGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use coderian/TinyGPT with Docker Model Runner:
docker model run hf.co/coderian/TinyGPT
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,21 +1,22 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
language:
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
| 11 |
library_name: transformers
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
base_model: gpt2
|
| 14 |
widget:
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
---
|
| 20 |
|
| 21 |
# TinyGPT
|
|
@@ -256,4 +257,4 @@ During inference, the `lm_head` logits directly represent the next-token distrib
|
|
| 256 |
|
| 257 |
MIT -- model weights and code are freely usable.
|
| 258 |
|
| 259 |
-
**HF Hub:** [huggingface.co/coderian/TinyGPT](https://huggingface.co/coderian/TinyGPT)
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
language:
|
| 4 |
+
- en
|
| 5 |
tags:
|
| 6 |
+
- text-generation
|
| 7 |
+
- causal-lm
|
| 8 |
+
- gpt
|
| 9 |
+
- tinygpt
|
| 10 |
+
- transformer
|
| 11 |
+
- llm
|
| 12 |
library_name: transformers
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
base_model: gpt2
|
| 15 |
widget:
|
| 16 |
+
- text: Once upon a time, a little boy named Sam
|
| 17 |
+
example_title: Story start
|
| 18 |
+
- text: The cat and the dog decided to
|
| 19 |
+
example_title: Animals
|
| 20 |
---
|
| 21 |
|
| 22 |
# TinyGPT
|
|
|
|
| 257 |
|
| 258 |
MIT -- model weights and code are freely usable.
|
| 259 |
|
| 260 |
+
**HF Hub:** [huggingface.co/coderian/TinyGPT](https://huggingface.co/coderian/TinyGPT)
|