Commit ·
0412214
1
Parent(s): 4c606f3
test
Browse files- handler.py +19 -1
handler.py
CHANGED
|
@@ -71,10 +71,28 @@ class EndpointHandler():
|
|
| 71 |
if prompt is None:
|
| 72 |
return {"error": "Please provide a prompt"}
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
if(image_depth_map is None):
|
| 75 |
-
with open("default.jpg", "rb") as image_file:
|
| 76 |
image = base64.b64encode(image_file.read()).decode('utf-8')
|
| 77 |
|
|
|
|
| 78 |
|
| 79 |
# process image
|
| 80 |
image = self.decode_base64_image(image)
|
|
|
|
| 71 |
if prompt is None:
|
| 72 |
return {"error": "Please provide a prompt"}
|
| 73 |
|
| 74 |
+
import os
|
| 75 |
+
print(os.getcwd())
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
# Ruta al archivo que quieres comprobar
|
| 79 |
+
archivo = './default.jpg'
|
| 80 |
+
|
| 81 |
+
# Comprobar permisos
|
| 82 |
+
permiso_lectura = os.access(archivo, os.R_OK)
|
| 83 |
+
permiso_escritura = os.access(archivo, os.W_OK)
|
| 84 |
+
permiso_ejecucion = os.access(archivo, os.X_OK)
|
| 85 |
+
|
| 86 |
+
# Imprimir los resultados
|
| 87 |
+
print(f"Permiso de lectura para '{archivo}': {'Sí' if permiso_lectura else 'No'}")
|
| 88 |
+
print(f"Permiso de escritura para '{archivo}': {'Sí' if permiso_escritura else 'No'}")
|
| 89 |
+
print(f"Permiso de ejecución para '{archivo}': {'Sí' if permiso_ejecucion else 'No'}")
|
| 90 |
+
|
| 91 |
if(image_depth_map is None):
|
| 92 |
+
with open("./default.jpg", "rb") as image_file:
|
| 93 |
image = base64.b64encode(image_file.read()).decode('utf-8')
|
| 94 |
|
| 95 |
+
|
| 96 |
|
| 97 |
# process image
|
| 98 |
image = self.decode_base64_image(image)
|