๐งช DialoGPT-medium-Rick
A fine-tuned DialoGPT-medium model trained on Rick Sanchez dialogue lines from Rick and Morty.
๐ฎ Interactive Live Demo (Running 100% on Hugging Face)
Test the chatbot live directly below (or open full-screen at Hugging Face Space):
๐ป Usage (Python / Transformers)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "iamhariraj/DialoGPT-medium-Rick"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompts = ["Hello Rick!", "What are you working on?"]
bot_input_ids = None
for p in prompts:
print("User:", p)
inp = tokenizer.encode(p + tokenizer.eos_token, return_tensors="pt")
bot_input_ids = torch.cat([bot_input_ids, inp], dim=-1) if bot_input_ids is not None else inp
out = model.generate(
bot_input_ids,
max_new_tokens=60,
do_sample=True,
top_k=50,
top_p=0.92,
temperature=0.75,
repetition_penalty=1.2,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(out[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)
print("Rick:", response)
bot_input_ids = out
- Downloads last month
- 327
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support