Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,20 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
-
|
5 |
-
{"role": "user", "content": "Who are you?"},
|
6 |
-
]
|
7 |
|
8 |
-
|
|
|
|
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
+
pipeline = pipeline(model = "meta-llama/Llama-3.2-1B-Instruct")
|
|
|
|
|
5 |
|
6 |
+
def inference(input):
|
7 |
+
output = pipeline(input)
|
8 |
+
return output
|
9 |
|
10 |
+
app = gr.Interface(
|
11 |
+
fn = inference,
|
12 |
+
inputs = [gr.Textbox(label = "Input")],
|
13 |
+
outputs = [gr.Textbox(label = "Output")],
|
14 |
+
title = "Demo",
|
15 |
+
examples = [
|
16 |
+
["Hello, World."]
|
17 |
+
]
|
18 |
+
)
|
19 |
+
|
20 |
+
app.launch()
|