momo commited on
Commit
71f8857
ยท
1 Parent(s): 3055a8f
Files changed (1) hide show
  1. app.py +9 -19
app.py CHANGED
@@ -64,26 +64,16 @@ 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
- # 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'
 
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
  # # global var
79
  # MODEL_NAME = 'jason9693/SoongsilBERT-base-beep'