Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -18,7 +18,6 @@ app = FastAPI()
|
|
18 |
# CORS issue write below code
|
19 |
origins = [
|
20 |
"http://localhost:3000", # Update this with the actual origin of your frontend
|
21 |
-
# "http://192.168.0.104:3000",
|
22 |
]
|
23 |
app.add_middleware(
|
24 |
CORSMiddleware,
|
@@ -42,6 +41,7 @@ async def ocr(
|
|
42 |
# languages: list = Body(["eng"])
|
43 |
):
|
44 |
try:
|
|
|
45 |
# Check if the file format is allowed
|
46 |
file_extension = image.filename.split(".")[-1].lower()
|
47 |
if file_extension not in VALID_IMAGE_EXTENSIONS:
|
|
|
18 |
# CORS issue write below code
|
19 |
origins = [
|
20 |
"http://localhost:3000", # Update this with the actual origin of your frontend
|
|
|
21 |
]
|
22 |
app.add_middleware(
|
23 |
CORSMiddleware,
|
|
|
41 |
# languages: list = Body(["eng"])
|
42 |
):
|
43 |
try:
|
44 |
+
print("[Hello]", image.filename.split(".")[-1].lower())
|
45 |
# Check if the file format is allowed
|
46 |
file_extension = image.filename.split(".")[-1].lower()
|
47 |
if file_extension not in VALID_IMAGE_EXTENSIONS:
|