Spaces:
Build error
Build error
Commit
·
3b51125
1
Parent(s):
819b3b8
Update app.py
Browse files
app.py
CHANGED
@@ -416,15 +416,18 @@ def my_inference_function(image,text):
|
|
416 |
img_dir = tempfile.mkdtemp()
|
417 |
|
418 |
img_path = os.path.join(img_dir, f"out_112.jpeg")
|
419 |
-
decodedData = base64.b64decode((image))
|
420 |
|
421 |
print("----- my_inference_function img_path -----")
|
422 |
print(img_path)
|
423 |
|
424 |
# Write Image from Base64 File
|
425 |
-
imgFile = open(img_path, 'wb')
|
426 |
-
imgFile.write(decodedData)
|
427 |
-
imgFile.close()
|
|
|
|
|
|
|
428 |
|
429 |
return editor.predict(img_path,[text])
|
430 |
|
|
|
416 |
img_dir = tempfile.mkdtemp()
|
417 |
|
418 |
img_path = os.path.join(img_dir, f"out_112.jpeg")
|
419 |
+
#decodedData = base64.b64decode((image))
|
420 |
|
421 |
print("----- my_inference_function img_path -----")
|
422 |
print(img_path)
|
423 |
|
424 |
# Write Image from Base64 File
|
425 |
+
#imgFile = open(img_path, 'wb')
|
426 |
+
#imgFile.write(decodedData)
|
427 |
+
#imgFile.close()
|
428 |
+
|
429 |
+
with open(img_path, "wb") as fh:
|
430 |
+
fh.write(base64.urlsafe_b64decode(image))
|
431 |
|
432 |
return editor.predict(img_path,[text])
|
433 |
|