Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,15 @@ model_list = [
|
|
19 |
#demo = gr.Interface.from_pipeline(pipe)
|
20 |
#demo.launch()
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
def predict(text, chosen_model):
|
23 |
|
24 |
# Initialize the pipeline with the chosen model
|
@@ -29,7 +38,7 @@ def predict(text, chosen_model):
|
|
29 |
return label
|
30 |
|
31 |
inputs = [
|
32 |
-
gr.Textbox(label="Text", value=
|
33 |
gr.Dropdown(label="Model", choices=model_list, value=model_list[1])
|
34 |
]
|
35 |
|
@@ -39,4 +48,4 @@ outputs = [
|
|
39 |
|
40 |
|
41 |
gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title=app_title,
|
42 |
-
description=app_description).launch()
|
|
|
19 |
#demo = gr.Interface.from_pipeline(pipe)
|
20 |
#demo.launch()
|
21 |
|
22 |
+
app_examples = [
|
23 |
+
["As pessoas tem que perceber que ser 'panasca' não é deixar de ser homem, é deixar de ser humano kkk"],
|
24 |
+
["Isso pulhiticos merdosos, continuem a importar lixo, até Portugal deixar de ser Portugal."],
|
25 |
+
["Vai pá puta que te pariu seu paneleiro do caralho, virgem ofendida"],
|
26 |
+
["Vamo-nos unir para criar um mundo mais inclusivo e tolerante."],
|
27 |
+
["Eu admiro muito a coragem e a determinação da minha colega de trabalho."],
|
28 |
+
["O tempo está ensolarado hoje, perfeito para um passeio no parque."]
|
29 |
+
]
|
30 |
+
|
31 |
def predict(text, chosen_model):
|
32 |
|
33 |
# Initialize the pipeline with the chosen model
|
|
|
38 |
return label
|
39 |
|
40 |
inputs = [
|
41 |
+
gr.Textbox(label="Text", value= app_examples[0][0]),
|
42 |
gr.Dropdown(label="Model", choices=model_list, value=model_list[1])
|
43 |
]
|
44 |
|
|
|
48 |
|
49 |
|
50 |
gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title=app_title,
|
51 |
+
description=app_description, examples=app_examples).launch()
|