li2017dailydialog/daily_dialog
Updated • 10.1k • 157
How to use devjwsong/gpt2-open-domain-dialogue with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="devjwsong/gpt2-open-domain-dialogue") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("devjwsong/gpt2-open-domain-dialogue")
model = AutoModelForCausalLM.from_pretrained("devjwsong/gpt2-open-domain-dialogue")How to use devjwsong/gpt2-open-domain-dialogue with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "devjwsong/gpt2-open-domain-dialogue"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "devjwsong/gpt2-open-domain-dialogue",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/devjwsong/gpt2-open-domain-dialogue
How to use devjwsong/gpt2-open-domain-dialogue with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "devjwsong/gpt2-open-domain-dialogue" \
--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": "devjwsong/gpt2-open-domain-dialogue",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "devjwsong/gpt2-open-domain-dialogue" \
--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": "devjwsong/gpt2-open-domain-dialogue",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use devjwsong/gpt2-open-domain-dialogue with Docker Model Runner:
docker model run hf.co/devjwsong/gpt2-open-domain-dialogue
This model is based on GPT2LMHeadModel which has been trained with a total of 4 open-domain dialogue dataset.
The details can be found on my blog posts:
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
BibTeX:
@misc{Song_2020,
title={Multi-turn chatbot project (3): GPT-2 chatbot with multi-turn generation settings},
url={https://songstudio.info/tech/tech-35},
journal={SongStudio},
author={Song, Jaewoo},
year={2020},
month={Nov}
}