Spaces:
Sleeping
Sleeping
all add
Browse files
app.py
CHANGED
@@ -64,17 +64,26 @@ if __name__ == '__main__':
|
|
64 |
"momo/KcBERT-base_Hate_speech_Privacy_Detection",
|
65 |
]
|
66 |
|
67 |
-
#Create a gradio app with a button that calls predict()
|
68 |
-
app = gr.Interface(
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
app.launch()
|
76 |
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
# # global var
|
80 |
# MODEL_NAME = 'jason9693/SoongsilBERT-base-beep'
|
|
|
64 |
"momo/KcBERT-base_Hate_speech_Privacy_Detection",
|
65 |
]
|
66 |
|
67 |
+
# #Create a gradio app with a button that calls predict()
|
68 |
+
# app = gr.Interface(
|
69 |
+
# fn=predict,
|
70 |
+
# inputs=[gr.inputs.Dropdown(model_name_list, label="Model Name"), 'text'], outputs=['label'],
|
71 |
+
# examples = [[MODEL_BUF["name"], text], [MODEL_BUF["name"], "4=π¦ 4β π¦"]],
|
72 |
+
# title="νκ΅μ΄ νμ€νν, κ°μΈμ 보 νλ³κΈ° (Korean Hate Speech and Privacy Detection)",
|
73 |
+
# description="Korean Hate Speech and Privacy Detection."
|
74 |
+
# )
|
75 |
+
# app.launch()
|
76 |
|
77 |
|
78 |
+
pipe = TextClassificationPipeline(
|
79 |
+
model = model,
|
80 |
+
tokenizer = tokenizer,
|
81 |
+
return_all_scores=True,
|
82 |
+
function_to_apply='sigmoid'
|
83 |
+
)
|
84 |
+
|
85 |
+
gr.Interface.from_pipeline(pipe).launch()
|
86 |
+
|
87 |
|
88 |
# # global var
|
89 |
# MODEL_NAME = 'jason9693/SoongsilBERT-base-beep'
|