Spaces:
Sleeping
Sleeping
File size: 517 Bytes
dfddde4 c3d5504 dfddde4 01655b3 427c52f dfddde4 01655b3 0779167 01655b3 427c52f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from transformers import pipeline
import gradio as gr
pipe1 = pipeline(model = "meta-llama/Llama-3.2-1B-Instruct")
#pipe2 = pipeline(model = "meta-llama/Llama-3.2-3B-Instruct")
def inference(input):
output = pipe1(
text_inputs = input
)
return output[0]['generated_text'][len(input):]
app = gr.Interface(
fn = inference,
inputs = [gr.Textbox(label = "Input")],
outputs = [gr.Textbox(label = "Output")],
title = "Demo",
examples = [
["Hello, Llama."]
]
).launch() |