Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Load your Hugging Face model | |
generator = pipeline("text-generation", model="aboutaleb/llama-3-8b-chat-tourismneweeest") | |
# Define the chatbot function | |
def chatbot(prompt): | |
# Generate a response based on the user's prompt | |
response = generator(prompt, max_length=50, num_return_sequences=1) | |
return response[0]["generated_text"] | |
# Create a Gradio interface with an input box and output box | |
iface = gr.Interface(fn=chatbot, inputs="text", outputs="text", title="Chatbot using Llama 3") | |
# Launch the interface | |
iface.launch() | |