Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -183,22 +183,26 @@ def set_visible_false():
|
|
183 |
def set_visible_true():
|
184 |
return gr.update(visible=True)
|
185 |
|
186 |
-
|
187 |
-
|
188 |
-
# Modify the 'iface' definition to use 'predict' as the function
|
189 |
iface = gr.Interface(
|
190 |
fn=predict, # Use 'predict' as the function
|
191 |
-
inputs=[
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
195 |
live=True,
|
196 |
title="Padlet API Caller with cURL and LLM",
|
197 |
-
description="Enter OpenAI GPT4 key, system message, and
|
198 |
)
|
199 |
|
200 |
-
# Add event handlers to call 'create_post' when the "
|
201 |
-
iface.inputs[
|
202 |
-
iface.inputs[
|
|
|
|
|
|
|
203 |
|
204 |
iface.launch()
|
|
|
183 |
def set_visible_true():
|
184 |
return gr.update(visible=True)
|
185 |
|
186 |
+
# Define the Gradio interface
|
|
|
|
|
187 |
iface = gr.Interface(
|
188 |
fn=predict, # Use 'predict' as the function
|
189 |
+
inputs=[
|
190 |
+
gr.inputs.Textbox(label="OpenAI GPT4 Key", type="password", placeholder="sk.."),
|
191 |
+
gr.inputs.Textbox(label="System Message", default=""),
|
192 |
+
gr.inputs.Textbox(label="Input Board ID for api_call"),
|
193 |
+
gr.inputs.Textbox(label="Output Board ID for create_post"),
|
194 |
+
],
|
195 |
+
outputs=gr.outputs.Textbox(label="Summary"),
|
196 |
live=True,
|
197 |
title="Padlet API Caller with cURL and LLM",
|
198 |
+
description="Enter OpenAI GPT4 key, system message, input board ID for api_call, and output board ID for create_post",
|
199 |
)
|
200 |
|
201 |
+
# Add event handlers to call 'api_call' and 'create_post' when the "Generate Summary" and "Post Summary" buttons are clicked
|
202 |
+
iface.inputs[4].submit(api_call, [gr.inputs.Textbox])
|
203 |
+
iface.inputs[4].click(api_call, [gr.inputs.Textbox])
|
204 |
+
|
205 |
+
iface.inputs[5].submit(create_post, [gr.inputs.Textbox, gr.outputs.Textbox])
|
206 |
+
iface.inputs[5].click(create_post, [gr.inputs.Textbox, gr.outputs.Textbox])
|
207 |
|
208 |
iface.launch()
|