- api/main.py +2 -3
api/main.py
CHANGED
|
@@ -90,15 +90,14 @@ def get_text2img(data:dict) -> dict:
|
|
| 90 |
__response['original']= data.get('texto')
|
| 91 |
__response['image']= __main.text_to_img(texto=data.get('texto'),
|
| 92 |
model=data.get('modelo'))
|
| 93 |
-
__r = __main.api_response(content=__response, media_type="image/png")
|
| 94 |
else:
|
| 95 |
raise __main.exception(status_code = 401, datail=f"Datos mal formados:\n{data}")
|
| 96 |
except Exception as e:
|
| 97 |
print(e)
|
| 98 |
#To-do ->agregar mas información en el error fecha, usuario, reqs
|
| 99 |
-
raise __main.exception(status_code = 403, datail=e)
|
| 100 |
finally:
|
| 101 |
-
return
|
| 102 |
|
| 103 |
@api.post("/texto_a_video/", status_code=201)
|
| 104 |
def get_text2video(data:dict) -> dict:
|
|
|
|
| 90 |
__response['original']= data.get('texto')
|
| 91 |
__response['image']= __main.text_to_img(texto=data.get('texto'),
|
| 92 |
model=data.get('modelo'))
|
|
|
|
| 93 |
else:
|
| 94 |
raise __main.exception(status_code = 401, datail=f"Datos mal formados:\n{data}")
|
| 95 |
except Exception as e:
|
| 96 |
print(e)
|
| 97 |
#To-do ->agregar mas información en el error fecha, usuario, reqs
|
| 98 |
+
raise __main.exception(status_code = 403, datail=str(e))
|
| 99 |
finally:
|
| 100 |
+
return __main.api_response(content=__response, media_type="image/png")
|
| 101 |
|
| 102 |
@api.post("/texto_a_video/", status_code=201)
|
| 103 |
def get_text2video(data:dict) -> dict:
|