AV-AV commited on
Commit
0fc35c6
·
verified ·
1 Parent(s): bcd7b30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -5
app.py CHANGED
@@ -142,9 +142,39 @@ def my_chatbot(prompt: str):
142
 
143
 
144
 
145
- demo = gr.Interface(fn=my_chatbot,
146
- inputs=[gr.Textbox(label="Query", lines=3)],
147
- outputs=[gr.Textbox(label="Tool", lines = 1), gr.Textbox(label="Tool", lines = 10)],
148
- title="Demo Agent",
149
- description= "Flag responses where inappropriate tool is used")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  demo.launch()
 
142
 
143
 
144
 
145
+ # demo = gr.Interface(fn=my_chatbot,
146
+ # inputs=[gr.Textbox(label="Query", lines=3)],
147
+ # outputs=[gr.Textbox(label="Tool", lines = 1), gr.Textbox(label="Tool", lines = 10)],
148
+ # title="Demo Agent",
149
+ # description= "Flag responses where inappropriate tool is used")
150
+ # demo.launch()
151
+
152
+
153
+
154
+ # Define custom CSS for the Gradio interface
155
+ custom_css = """
156
+ input[type="text"], textarea {
157
+ font-size: 18px !important;
158
+ }
159
+ textarea {
160
+ height: auto !important;
161
+ }
162
+ .gr-textbox {
163
+ font-size: 18px !important;
164
+ }
165
+ """
166
+
167
+ # Create the interface with the desired layout and custom CSS
168
+ with gr.Blocks(css=custom_css) as demo:
169
+ gr.Markdown("# Demo Agent\nFlag responses where inappropriate tool is used")
170
+ with gr.Row():
171
+ query_input = gr.Textbox(label="Query", lines=3, interactive=True)
172
+ with gr.Column():
173
+ tool_output = gr.Textbox(label="Tool", lines=1)
174
+ detailed_output = gr.Textbox(label="Detailed Response", lines=10)
175
+
176
+ # Define the interaction between input and outputs
177
+ query_input.submit(my_chatbot, inputs=query_input, outputs=[tool_output, detailed_output])
178
+
179
+ # Launch the interface
180
  demo.launch()