File size: 560 Bytes
d3b4f30
b1f106d
 
 
 
 
 
 
33c200c
b1f106d
 
 
33c200c
b1f106d
 
33c200c
 
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 the model
model_name = "nvidia/Llama3-ChatQA-1.5-8B"
qa_pipeline = pipeline("text-generation", model=model_name)

def generate_answer(question):
    # Generate the answer using the model
    response = qa_pipeline(question, max_length=250)
    return response[0]["generated_text"]

# Create the Gradio interface
iface = gr.Interface(fn=generate_answer, inputs="text", outputs="text", title="Llama3 ChatQA")

# Launch the interface and set share=True to create a public URL
iface.launch(share=True)