Vo1dAbyss's picture
Update app.py
6a25bc8 verified
raw
history blame contribute delete
711 Bytes
print("Importing packages...")
from transformers import pipeline, Conversation
import gradio as gr
print("Done!")
print("Importing chatbot...")
chatbot = pipeline(task="conversational", model="meta-llama/Llama-2-70b")
print("Done!")
message_list = []
response_list = []
print("Creating gradio interface...")
def chocolate_chatbot(message, history):
conversation = Conversation(text=message, past_user_inputs=message_list, generated_responses=response_list)
conversation = chatbot(conversation)
return conversation.generated_responses[-1]
gr_chatbot = gr.ChatInterface(chocolate_chatbot, title="Chocolate Chatbot", description="Enter text to start chatting.")
print("Launching...")
gr_chatbot.launch()