Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
|
|
|
|
5 |
app_title = "Portuguese Hate Speech Detection"
|
6 |
|
7 |
app_description = """
|
@@ -47,7 +49,7 @@ def predict(text, chosen_model):
|
|
47 |
non_predicted_label: non_predicted_score
|
48 |
}
|
49 |
|
50 |
-
return scores_dict
|
51 |
|
52 |
inputs = [
|
53 |
gr.Textbox(label="Text", value= app_examples[0][0]),
|
@@ -58,6 +60,5 @@ outputs = [
|
|
58 |
gr.Label(label="Result"),
|
59 |
]
|
60 |
|
61 |
-
|
62 |
gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title=app_title,
|
63 |
description=app_description, examples=app_examples).launch()
|
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
gr.themes.Base()
|
6 |
+
|
7 |
app_title = "Portuguese Hate Speech Detection"
|
8 |
|
9 |
app_description = """
|
|
|
49 |
non_predicted_label: non_predicted_score
|
50 |
}
|
51 |
|
52 |
+
return scores_dict
|
53 |
|
54 |
inputs = [
|
55 |
gr.Textbox(label="Text", value= app_examples[0][0]),
|
|
|
60 |
gr.Label(label="Result"),
|
61 |
]
|
62 |
|
|
|
63 |
gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title=app_title,
|
64 |
description=app_description, examples=app_examples).launch()
|