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