Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,12 @@ def codeinterpreter(openai_key,prompt, files):
|
|
21 |
#async with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key="") as session:
|
22 |
response = session.generate_response_sync(prompt, fileList,True)
|
23 |
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
|
@@ -30,6 +35,6 @@ app = gr.Interface(
|
|
30 |
gr.Textbox(label="openai_key"),
|
31 |
gr.Textbox(label="prompt",info="input the prompt"),
|
32 |
gr.Files(),
|
33 |
-
], outputs=["text","files"]
|
34 |
)
|
35 |
app.launch()
|
|
|
21 |
#async with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key="") as session:
|
22 |
response = session.generate_response_sync(prompt, fileList,True)
|
23 |
|
24 |
+
images = []
|
25 |
+
|
26 |
+
for _file in response.files:
|
27 |
+
images.append(_file.get_image())
|
28 |
+
|
29 |
+
return [response.content,images,response.files]
|
30 |
|
31 |
|
32 |
|
|
|
35 |
gr.Textbox(label="openai_key"),
|
36 |
gr.Textbox(label="prompt",info="input the prompt"),
|
37 |
gr.Files(),
|
38 |
+
], outputs=["text","gallery","files"]
|
39 |
)
|
40 |
app.launch()
|