Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -116,14 +116,10 @@ def chat(user_msg, mode, threshold=None):
|
|
116 |
with gr.Blocks() as demo:
|
117 |
# チャットボットUI処理
|
118 |
chatbot = gr.Chatbot()
|
119 |
-
input = gr.Textbox(show_label=False, placeholder="チェックしたい文章を入力してください")
|
120 |
-
mode = gr.Radio(["理由を出力", "確率を出力"], label="モードを選択")
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
threshold = gr.Slider(minimum=0, maximum=1, value=0.3, step=0.05, label="NG度の閾値")
|
126 |
-
input.submit(fn=chat, inputs=[input, mode, threshold], outputs=chatbot) # メッセージ送信されたら、AIと会話してチャット欄に全会話内容を表示
|
127 |
|
128 |
input.submit(fn=lambda: "", inputs=None, outputs=input) # (上記に加えて)入力欄をクリア
|
129 |
|
|
|
116 |
with gr.Blocks() as demo:
|
117 |
# チャットボットUI処理
|
118 |
chatbot = gr.Chatbot()
|
|
|
|
|
119 |
|
120 |
+
input = gr.Textbox(show_label=False, placeholder="チェックしたい文章を入力してください")
|
121 |
+
|
122 |
+
input.submit(fn=chat, inputs=[input, gr.Radio(["理由を出力", "確率を出力"], label="モードを選択"), threshold = gr.Slider(minimum=0, maximum=1, value=0.3, step=0.05, label="NG度の閾値")], outputs=chatbot) # メッセージ送信されたら、AIと会話してチャット欄に全会話内容を表示
|
|
|
|
|
123 |
|
124 |
input.submit(fn=lambda: "", inputs=None, outputs=input) # (上記に加えて)入力欄をクリア
|
125 |
|