Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,7 +135,7 @@ def run_predict():
|
|
| 135 |
logger.exception("Unhandled server error")
|
| 136 |
return jsonify({"jsonrpc": "2.0", "error": f"Server error: {str(e)}"}), 500
|
| 137 |
|
| 138 |
-
# --- Gradio UI ---
|
| 139 |
flag_reasons = [
|
| 140 |
"Incorrect response",
|
| 141 |
"Output is confusing",
|
|
@@ -151,12 +151,10 @@ def launch_gradio():
|
|
| 151 |
outputs=[gr.Textbox(label="Chatbot Response", lines=20)],
|
| 152 |
title="Township Business Chatbot UI",
|
| 153 |
description="Send JSON-RPC commands to the backend",
|
| 154 |
-
flagging_dir="flagged",
|
| 155 |
-
flagging_options=flag_reasons
|
| 156 |
-
server_name="0.0.0.0",
|
| 157 |
-
ssr_mode=False,
|
| 158 |
)
|
| 159 |
-
iface.launch(
|
| 160 |
except OSError as e:
|
| 161 |
logger.error(f"⚠️ Gradio failed to launch: {str(e)}")
|
| 162 |
|
|
|
|
| 135 |
logger.exception("Unhandled server error")
|
| 136 |
return jsonify({"jsonrpc": "2.0", "error": f"Server error: {str(e)}"}), 500
|
| 137 |
|
| 138 |
+
# --- Gradio UI Launch ---
|
| 139 |
flag_reasons = [
|
| 140 |
"Incorrect response",
|
| 141 |
"Output is confusing",
|
|
|
|
| 151 |
outputs=[gr.Textbox(label="Chatbot Response", lines=20)],
|
| 152 |
title="Township Business Chatbot UI",
|
| 153 |
description="Send JSON-RPC commands to the backend",
|
| 154 |
+
flagging_dir="flagged",
|
| 155 |
+
flagging_options=flag_reasons
|
|
|
|
|
|
|
| 156 |
)
|
| 157 |
+
iface.launch(server_name="0.0.0.0", server_port=7860)
|
| 158 |
except OSError as e:
|
| 159 |
logger.error(f"⚠️ Gradio failed to launch: {str(e)}")
|
| 160 |
|