johnhelf commited on
Commit
4cd35b4
1 Parent(s): 944a11c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
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
- return [response.content,response.files]
 
 
 
 
 
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()