import gradio as gr | |
# Define the Gradio interface | |
iface = gr.Interface( | |
fn=generate_response, | |
inputs=[ | |
gr.inputs.Textbox(lines=2, label="Input Prompt"), | |
gr.inputs.Slider(minimum=50, maximum=200, step=10, default=100, label="Max Length"), | |
gr.inputs.Slider(minimum=0.1, maximum=1.0, step=0.1, default=0.7, label="Temperature") | |
], | |
outputs=gr.outputs.Textbox(label="Generated Response"), | |
title="Llama 2 Chatbot", | |
description="Interact with the Llama 2 model using Gradio." | |
) | |
# Launch the interface | |
iface.launch() | |