Text Generation
Transformers
PyTorch
English
gpt2
conversational
dialogpt
rick-and-morty
fine-tuned
text-generation-inference
Instructions to use iamhariraj/DialoGPT-small-Rick with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iamhariraj/DialoGPT-small-Rick with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iamhariraj/DialoGPT-small-Rick") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("iamhariraj/DialoGPT-small-Rick") model = AutoModelForCausalLM.from_pretrained("iamhariraj/DialoGPT-small-Rick") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use iamhariraj/DialoGPT-small-Rick with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iamhariraj/DialoGPT-small-Rick" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iamhariraj/DialoGPT-small-Rick", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/iamhariraj/DialoGPT-small-Rick
- SGLang
How to use iamhariraj/DialoGPT-small-Rick 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 "iamhariraj/DialoGPT-small-Rick" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iamhariraj/DialoGPT-small-Rick", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "iamhariraj/DialoGPT-small-Rick" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iamhariraj/DialoGPT-small-Rick", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use iamhariraj/DialoGPT-small-Rick with Docker Model Runner:
docker model run hf.co/iamhariraj/DialoGPT-small-Rick
DialoGPT-small-Rick π§ͺ
A conversational AI fine-tuned to talk like Rick Sanchez from Rick and Morty. Built on top of microsoft/DialoGPT-small and trained on Rick's dialogue from the show.
π Try it Live
π RickChatBot β Gradio Space
π§ Model Details
| Property | Value |
|---|---|
| Base Model | microsoft/DialoGPT-small |
| Architecture | GPT-2 (117M parameters) |
| Task | Conversational Text Generation |
| Fine-tuned on | Rick Sanchez dialogue (Rick & Morty) |
| Framework | PyTorch + HuggingFace Transformers |
| Language | English |
π¬ How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("iamhariraj/DialoGPT-small-Rick")
model = AutoModelForCausalLM.from_pretrained("iamhariraj/DialoGPT-small-Rick")
chat_history_ids = None
print("Talk to Rick (type 'quit' to exit)")
while True:
user_input = input("You: ")
if user_input.lower() == "quit":
break
input_ids = tokenizer.encode(
user_input + tokenizer.eos_token,
return_tensors="pt"
)
if chat_history_ids is not None:
input_ids = torch.cat([chat_history_ids, input_ids], dim=-1)
chat_history_ids = model.generate(
input_ids,
max_length=1000,
pad_token_id=tokenizer.eos_token_id,
no_repeat_ngram_size=3,
do_sample=True,
top_k=100,
top_p=0.7,
temperature=0.8
)
response = tokenizer.decode(
chat_history_ids[:, input_ids.shape[-1]:][0],
skip_special_tokens=True
)
print(f"Rick: {response}")
π― Example Conversations
| You | Rick |
|---|---|
| "What is the meaning of life?" | (Rick-style nihilistic response) |
| "Can you build me a portal gun?" | (Rick flexing his genius) |
| "I need your help" | (sarcastic Rick response) |
β οΈ Limitations
- Based on DialoGPT-small β responses can sometimes be generic or repetitive
- May not always stay perfectly in character
- Not suitable for serious or sensitive conversations
- Trained on a limited dialogue dataset
π§ Training
- Base: microsoft/DialoGPT-small
- Data: Rick Sanchez lines extracted from Rick and Morty scripts
- Framework: HuggingFace Transformers + PyTorch
- Trainer: HuggingFace
TrainerAPI
π€ Author
Made by iamhariraj
π License
MIT
- Downloads last month
- 1,380
Model tree for iamhariraj/DialoGPT-small-Rick
Base model
microsoft/DialoGPT-small