You can modify this app directly by editing index.html in the Files and versions tab.
Also don't forget to check the Spaces documentation.
from transformers import pipeline # Load a pre-trained conversational model chatbot = pipeline("text-generation", model="microsoft/DialoGPT-medium") # Function to interact with the chatbot def interact_with_chatbot(prompt): conversation = chatbot(prompt) return conversation[0]['generated_text'] # Example interaction user_input = input("You: ") while user_input.lower() != 'exit': response = interact_with_chatbot(user_input) print(f"Chatbot: {response}") user_input = input("You: ")