richardkimsm89 commited on
Commit
01655b3
·
verified ·
1 Parent(s): 988ff56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -1,10 +1,20 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
- messages = [
5
- {"role": "user", "content": "Who are you?"},
6
- ]
7
 
8
- pipe = pipeline(model="meta-llama/Llama-3.2-1B-Instruct")
 
 
9
 
10
- pipe(messages, max_length=512)
 
 
 
 
 
 
 
 
 
 
 
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()