johnhelf commited on
Commit
c5e39b8
1 Parent(s): 76cb978

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
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()