Spaces:
Build error
Build error
PatrickSchrML
commited on
Commit
·
16217a1
1
Parent(s):
2357596
fix
Browse files
app.py
CHANGED
|
@@ -6,11 +6,11 @@ from datasets import load_dataset
|
|
| 6 |
from PIL import Image
|
| 7 |
from io import BytesIO
|
| 8 |
# import base64
|
| 9 |
-
import re
|
| 10 |
import os
|
| 11 |
import requests
|
| 12 |
import json
|
| 13 |
-
from urllib import parse
|
| 14 |
|
| 15 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 16 |
|
|
@@ -40,7 +40,7 @@ def infer(prompt, n_samples, steps, scale, seed):
|
|
| 40 |
# images.append(image)
|
| 41 |
# else:
|
| 42 |
url = os.getenv('BACKEND_URL')
|
| 43 |
-
response = requests.get(url.format(
|
| 44 |
data = json.load(BytesIO(response.content))
|
| 45 |
for image in data['output']['choices']:
|
| 46 |
image_b64 = (f"data:image/jpeg;base64,{image['image_base64']}")
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
from io import BytesIO
|
| 8 |
# import base64
|
| 9 |
+
# import re
|
| 10 |
import os
|
| 11 |
import requests
|
| 12 |
import json
|
| 13 |
+
# from urllib import parse
|
| 14 |
|
| 15 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 16 |
|
|
|
|
| 40 |
# images.append(image)
|
| 41 |
# else:
|
| 42 |
url = os.getenv('BACKEND_URL')
|
| 43 |
+
response = requests.get(url.format(prompt, n_samples, steps, scale, seed))
|
| 44 |
data = json.load(BytesIO(response.content))
|
| 45 |
for image in data['output']['choices']:
|
| 46 |
image_b64 = (f"data:image/jpeg;base64,{image['image_base64']}")
|