Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,10 @@ from codeinterpreterapi import CodeInterpreterSession
|
|
10 |
|
11 |
|
12 |
|
13 |
-
async def codeinterpreter(prompt, files):
|
14 |
|
15 |
-
async with CodeInterpreterSession(model="gpt-3.5
|
|
|
16 |
response = await session.generate_response(prompt, files=files)
|
17 |
|
18 |
return [response.content,response.files]
|
@@ -21,6 +22,7 @@ async def codeinterpreter(prompt, files):
|
|
21 |
|
22 |
app = gr.Interface(
|
23 |
fn=codeinterpreter, inputs=[
|
|
|
24 |
gr.Textbox(label="prompt",info="input the prompt"),
|
25 |
gr.Files(),
|
26 |
], outputs=["text","gallery"]
|
|
|
10 |
|
11 |
|
12 |
|
13 |
+
async def codeinterpreter(openai_key,prompt, files):
|
14 |
|
15 |
+
async with CodeInterpreterSession(model="gpt-3.5",openai_api_key=openai_key) as session:
|
16 |
+
#async with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key="") as session:
|
17 |
response = await session.generate_response(prompt, files=files)
|
18 |
|
19 |
return [response.content,response.files]
|
|
|
22 |
|
23 |
app = gr.Interface(
|
24 |
fn=codeinterpreter, inputs=[
|
25 |
+
gr.Textbox(label="openai_key"),
|
26 |
gr.Textbox(label="prompt",info="input the prompt"),
|
27 |
gr.Files(),
|
28 |
], outputs=["text","gallery"]
|