hc1608 commited on
Commit
a7f4491
·
1 Parent(s): 8b4499c

created app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import io
3
+ from PIL import Image
4
+ def query(payload):
5
+ response = requests.post(API_URL, headers=headers, json=payload)
6
+ image_bytes = response.content
7
+ image = Image.open(io.BytesIO(image_bytes))
8
+ return image
9
+
10
+ demo = gr.Interface(fn=query, inputs="text", outputs="image")
11
+
12
+ if __name__ == "__main__":
13
+ demo.launch(share = True)