Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,17 +32,30 @@ def codeinterpreter(openai_key,prompt, files):
|
|
32 |
return [response.content,images]
|
33 |
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
[""
|
46 |
-
["",
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
app.launch()
|
|
|
32 |
return [response.content,images]
|
33 |
|
34 |
|
35 |
+
with gr.Blocks() as app:
|
36 |
+
with gr.Row():
|
37 |
+
with gr.Column():
|
38 |
+
inp1=gr.Textbox(label="openai_key")
|
39 |
+
inp2=gr.Textbox(label="prompt",info="input the prompt")
|
40 |
+
inp3=gr.Files()
|
41 |
+
with gr.Column():
|
42 |
+
out1=gr.Textbox(label="result")
|
43 |
+
out2=gr.Gallery()
|
44 |
+
gr.Examples([["Plot the nvidea stock vs microsoft stock over the last 6 months."],
|
45 |
+
["Plot a sin wave and show it to me."],
|
46 |
+
["贵州茅台最近半年走势"],
|
47 |
+
[Plot the bitcoin chart of 2023 YTD"]],
|
48 |
+
[inp2])
|
49 |
+
btn = gr.Button(value="Mirror Image")
|
50 |
+
btn.click(codeinterpreter, inputs=[inp1,inp2,inp3], outputs=[out1,out2])
|
51 |
+
|
52 |
+
# app = gr.Interface(
|
53 |
+
# fn=codeinterpreter,
|
54 |
+
# inputs=[inp1,inp2,inp3],
|
55 |
+
# outputs=["text","gallery"],
|
56 |
+
# examples=[["","Plot the nvidea stock vs microsoft stock over the last 6 months.",None],
|
57 |
+
# ["","Plot a sin wave and show it to me.",None],
|
58 |
+
# ["","怡亚通最近半年走势",None],
|
59 |
+
# ["","Plot the bitcoin chart of 2023 YTD",None]]
|
60 |
+
# )
|
61 |
app.launch()
|