Instructions to use jamiewjm/CCGwGPT2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jamiewjm/CCGwGPT2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jamiewjm/CCGwGPT2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jamiewjm/CCGwGPT2") model = AutoModelForCausalLM.from_pretrained("jamiewjm/CCGwGPT2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jamiewjm/CCGwGPT2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jamiewjm/CCGwGPT2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jamiewjm/CCGwGPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jamiewjm/CCGwGPT2
- SGLang
How to use jamiewjm/CCGwGPT2 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 "jamiewjm/CCGwGPT2" \ --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": "jamiewjm/CCGwGPT2", "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 "jamiewjm/CCGwGPT2" \ --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": "jamiewjm/CCGwGPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jamiewjm/CCGwGPT2 with Docker Model Runner:
docker model run hf.co/jamiewjm/CCGwGPT2
Upload README.md with huggingface_hub
#1
by lbourdois - opened
README.md
CHANGED
|
@@ -1,32 +1,3 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
| 3 |
-
widget:
|
| 4 |
-
- text: "五言藏头:春天到来|桃花|"
|
| 5 |
---
|
| 6 |
-
|
| 7 |
-
# 输入格式
|
| 8 |
-
> 格式|题目|正文
|
| 9 |
-
|
| 10 |
-
格式为下列之一:
|
| 11 |
-
|
| 12 |
-
* 五绝
|
| 13 |
-
* 五律
|
| 14 |
-
* 七绝
|
| 15 |
-
* 七律
|
| 16 |
-
* 五言排律
|
| 17 |
-
* 七言排律
|
| 18 |
-
* 五言藏头:藏头字...
|
| 19 |
-
* 七言藏头:藏头字...
|
| 20 |
-
* 对联
|
| 21 |
-
----- removed -----
|
| 22 |
-
* 诗经
|
| 23 |
-
* 乐府
|
| 24 |
-
* 楚辞
|
| 25 |
-
* 词牌名 (水调歌头、菩萨蛮...)
|
| 26 |
-
* 古诗
|
| 27 |
-
|
| 28 |
-
若为空则默认五言绝句。
|
| 29 |
-
|
| 30 |
-
题目为诗歌的主题,可为空。
|
| 31 |
-
|
| 32 |
-
正文部分可指定起始字符,可为空
|
|
|
|
| 1 |
---
|
| 2 |
+
language: zh
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|