ramagururadhakrishnan commited on
Commit
a124cb4
·
verified ·
1 Parent(s): 7a7dd94

Position of the Output area

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -140,12 +140,16 @@ def analyze_chat(file_bytes):
140
  # -------------------------------
141
  # Gradio App Launch
142
  # -------------------------------
143
- iface = gr.Interface(
144
- fn=analyze_chat,
145
- inputs=gr.File(label="Upload Chat CSV/JSON", file_types=['.csv', '.json'], type='binary'),
146
- outputs=[gr.Textbox(label="Metrics"), gr.Plot(label="Risk Graph")],
147
- title="Sex Chat Detection",
148
- description="Upload a chat file (CSV or JSON) to detect sex chat, compute metrics, and visualize the user-word graph."
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
+