0xcyborg commited on
Commit
6fda1e4
1 Parent(s): 31ad7e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -4,6 +4,7 @@ import time
4
  import requests
5
  import io
6
  from PIL import Image
 
7
 
8
  from base64 import b64decode,b64encode
9
  from io import BytesIO
@@ -15,14 +16,19 @@ with gr.Blocks(theme="darkdefault") as demo:
15
  return f"Welcome to AIXRPL.com Minter, {name}!"
16
 
17
  def inference(_prompt,_token):
18
- from PIL import Image
19
- import uuid
20
- import os
21
- print(_prompt,_token)
22
- r = requests.post(url='https://xcyborgart-app.herokuapp.com/create',data={"prompt":_prompt,"token":_token})
23
- all_data = r.json()
24
- print(all_data)
25
- return all_data['data'],all_data['description'],all_data['image_url'],all_data['keywords'],all_data['keywords_string']
 
 
 
 
 
26
  # img.save('/tmp/data.png')
27
  #return '/tmp/data.png'
28
 
 
4
  import requests
5
  import io
6
  from PIL import Image
7
+ import traceback
8
 
9
  from base64 import b64decode,b64encode
10
  from io import BytesIO
 
16
  return f"Welcome to AIXRPL.com Minter, {name}!"
17
 
18
  def inference(_prompt,_token):
19
+ try:
20
+ from PIL import Image
21
+ import uuid
22
+ import os
23
+ print(_prompt,_token)
24
+ r = requests.post(url='https://xcyborgart-app.herokuapp.com/create',data={"prompt":_prompt,"token":_token})
25
+ all_data = r.json()
26
+ print(all_data)
27
+ return all_data['data'],all_data['description'],all_data['image_url'],all_data['keywords'],all_data['keywords_string']
28
+ except Exception as e:
29
+ print('exception:',e)
30
+ traceback.print_exc()
31
+ return '','','','',''
32
  # img.save('/tmp/data.png')
33
  #return '/tmp/data.png'
34