Downloads · 30 days
23
0% of all-time downloads
iamhariraj/DialoGPT-small-Rick
DialoGPT-small-Rick is a text generation model from iamhariraj. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
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.
Downloads · 30 days
23
0% of all-time downloads
All-time downloads
7K
Public
Repo size
1.5 GB
Likes
1
Public
Click a slice to open those files.
.bin498 MB · 99%
From the Hugging Face model README
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.
| 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 |
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}")
| 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) |
Trainer APIMade by iamhariraj
MIT