Position of the Output area
Browse files
app.py
CHANGED
|
@@ -140,12 +140,16 @@ def analyze_chat(file_bytes):
|
|
| 140 |
# -------------------------------
|
| 141 |
# Gradio App Launch
|
| 142 |
# -------------------------------
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
)
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
iface.launch()
|
|
|
|
|
|
| 140 |
# -------------------------------
|
| 141 |
# Gradio App Launch
|
| 142 |
# -------------------------------
|
| 143 |
+
with gr.Blocks(title="Sex Chat Detection") as iface:
|
| 144 |
+
with gr.Row():
|
| 145 |
+
with gr.Column(scale=1):
|
| 146 |
+
file_input = gr.File(label="Upload Chat CSV/JSON", file_types=['.csv', '.json'], type='binary')
|
| 147 |
+
metrics_output = gr.Textbox(label="Metrics", lines=15)
|
| 148 |
+
with gr.Column(scale=1):
|
| 149 |
+
graph_output = gr.Plot(label="Risk Graph")
|
| 150 |
+
|
| 151 |
+
# Connect inputs and outputs
|
| 152 |
+
file_input.change(fn=analyze_chat, inputs=file_input, outputs=[metrics_output, graph_output])
|
| 153 |
|
| 154 |
iface.launch()
|
| 155 |
+
|