Instructions to use ethzanalytics/ai-msgbot-gpt2-XL-dialogue with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ethzanalytics/ai-msgbot-gpt2-XL-dialogue with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ethzanalytics/ai-msgbot-gpt2-XL-dialogue")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ethzanalytics/ai-msgbot-gpt2-XL-dialogue") model = AutoModelForCausalLM.from_pretrained("ethzanalytics/ai-msgbot-gpt2-XL-dialogue") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ethzanalytics/ai-msgbot-gpt2-XL-dialogue with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ethzanalytics/ai-msgbot-gpt2-XL-dialogue" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ethzanalytics/ai-msgbot-gpt2-XL-dialogue", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ethzanalytics/ai-msgbot-gpt2-XL-dialogue
- SGLang
How to use ethzanalytics/ai-msgbot-gpt2-XL-dialogue 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 "ethzanalytics/ai-msgbot-gpt2-XL-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": "ethzanalytics/ai-msgbot-gpt2-XL-dialogue", "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 "ethzanalytics/ai-msgbot-gpt2-XL-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": "ethzanalytics/ai-msgbot-gpt2-XL-dialogue", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ethzanalytics/ai-msgbot-gpt2-XL-dialogue with Docker Model Runner:
docker model run hf.co/ethzanalytics/ai-msgbot-gpt2-XL-dialogue
ai-msgbot: GPT2-XL-dialogue
GPT2-XL (~1.5 B parameters) trained on the Wizard of Wikipedia dataset for 40k steps with 33/36 layers frozen using aitextgen. The resulting model was then further fine-tuned on the Daily Dialogues for 40k steps, with 34/36 layers frozen.
Designed for use with ai-msgbot to create an open-ended chatbot (of course, if other use cases arise, have at it).
conversation data
The dataset was tokenized and fed to the model as a conversation between two speakers, whose names are below. This is relevant for writing prompts and filtering/extracting text from responses.
script_speaker_name = person alpha
script_responder_name = person beta
examples
- the default inference API examples should work okay
- an ideal test would be explicitly adding
person betainto the prompt text the model is forced to respond to instead of adding onto the entered prompt.
citations
@inproceedings{dinan2019wizard,
author={Emily Dinan and Stephen Roller and Kurt Shuster and Angela Fan and Michael Auli and Jason Weston},
title={{W}izard of {W}ikipedia: Knowledge-powered Conversational Agents},
booktitle = {Proceedings of the International Conference on Learning Representations (ICLR)},
year={2019},
}
@inproceedings{li-etal-2017-dailydialog,
title = "{D}aily{D}ialog: A Manually Labelled Multi-turn Dialogue Dataset",
author = "Li, Yanran and
Su, Hui and
Shen, Xiaoyu and
Li, Wenjie and
Cao, Ziqiang and
Niu, Shuzi",
booktitle = "Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers)",
month = nov,
year = "2017",
address = "Taipei, Taiwan",
publisher = "Asian Federation of Natural Language Processing",
url = "https://aclanthology.org/I17-1099",
pages = "986--995",
abstract = "We develop a high-quality multi-turn dialog dataset, \textbf{DailyDialog}, which is intriguing in several aspects. The language is human-written and less noisy. The dialogues in the dataset reflect our daily communication way and cover various topics about our daily life. We also manually label the developed dataset with communication intention and emotion information. Then, we evaluate existing approaches on DailyDialog dataset and hope it benefit the research field of dialog systems. The dataset is available on \url{http://yanran.li/dailydialog}",
}
- Downloads last month
- 11