Aya-test-1 / app.py
Ayaceti's picture
Update app.py
eeff931 verified
raw
history blame
No virus
648 Bytes
from transformers import pipeline
# Load the conversational model
chatbot = pipeline("conversational", model="microsoft/DialoGPT-medium")
def respond(message):
# Construct a friendly prompt for Aya
prompt = f"You are Aya, a friendly AI that speaks in simple, clear language. You always respond positively and encouragingly. Here’s what the user says: {message} \nYour response:"
# Generate response
response = chatbot(prompt)
generated_text = response[-1]['generated_text']
# Optionally add emojis and excitement
if "!" not in generated_text:
generated_text += " :3"
return generated_text