Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -25,7 +25,6 @@ async def ocr(
|
|
25 |
# languages: list = Body(["eng"])
|
26 |
request: Request,
|
27 |
# body: dict = Body(...),
|
28 |
-
message: str = Body("message"),
|
29 |
api_key: str = Depends(get_api_key),
|
30 |
):
|
31 |
# print("[where?] outside try block")
|
@@ -39,12 +38,12 @@ async def ocr(
|
|
39 |
# print("[image]",image)
|
40 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
41 |
# print("[text]",text)
|
42 |
-
|
43 |
except Exception as e:
|
44 |
return {"error": str(e)}, 500
|
45 |
|
46 |
# return jsonable_encoder({"text": text})
|
47 |
-
return {"messageDetails":
|
48 |
|
49 |
@app.post("/api/translate", response_model=dict)
|
50 |
async def translate(
|
|
|
25 |
# languages: list = Body(["eng"])
|
26 |
request: Request,
|
27 |
# body: dict = Body(...),
|
|
|
28 |
api_key: str = Depends(get_api_key),
|
29 |
):
|
30 |
# print("[where?] outside try block")
|
|
|
38 |
# print("[image]",image)
|
39 |
# text = pytesseract.image_to_string(image, lang="+".join(languages))
|
40 |
# print("[text]",text)
|
41 |
+
message = "file uploaded"
|
42 |
except Exception as e:
|
43 |
return {"error": str(e)}, 500
|
44 |
|
45 |
# return jsonable_encoder({"text": text})
|
46 |
+
return {"messageDetails": message}
|
47 |
|
48 |
@app.post("/api/translate", response_model=dict)
|
49 |
async def translate(
|