File size: 313 Bytes
5754dc6
c1e05b4
5754dc6
c1e05b4
 
5754dc6
c1e05b4
 
 
 
 
5754dc6
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
from transformers import pipeline

# Use a pipeline as a high-level helper
pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")

def llama_chat(name):
    resp = pipe(name)
    return resp

iface = gr.Interface(fn=llama_chat, inputs="text", outputs="text")
iface.launch()