Spaces:
Runtime error
Runtime error
File size: 605 Bytes
c5e39b8 27c02bd c5e39b8 27c02bd c5e39b8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# -* coding:UTF-8 -*
# !/usr/bin/env python
import numpy as np
import gradio as gr
import os
from PIL import Image
from codeinterpreterapi import CodeInterpreterSession
async def codeinterpreter(prompt, files):
async with CodeInterpreterSession(model="gpt-3.5-turbo") as session:
response = await session.generate_response(prompt, files=files)
return [response.content,response.files]
app = gr.Interface(
fn=codeinterpreter, inputs=[
gr.TextBox(label="prompt",info="input the prompt"),
gr.Files(),
], outputs=["text","gallery"]
)
app.launch() |