edersonmelo commited on
Commit
b2d61f6
·
1 Parent(s): c213d80

Add application file

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline("text-generation",
5
+ model="Qwen/Qwen2.5-7B-Instruct")
6
+
7
+ def gerar(texto):
8
+ result = pipe(texto, max_new_tokens=80)
9
+ return result[0]["generated_text"]
10
+
11
+ iface = gr.Interface(
12
+ fn=gerar,
13
+ inputs="text",
14
+ outputs="text",
15
+ title="Exemplo simples com Qwen"
16
+ )
17
+
18
+ iface.launch()