File size: 591 Bytes
4b88cc8
024109c
4b88cc8
024109c
 
4b88cc8
024109c
 
 
 
 
4b88cc8
024109c
 
4b88cc8
024109c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()