Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -131,7 +131,7 @@ async def marathi_ocr(file: UploadFile = File(...)):
|
|
| 131 |
|
| 132 |
logger.info("Attempting Gemini OCR...")
|
| 133 |
# Using gemini-1.5-flash for speed and efficiency, or use 'gemini-1.5-pro' for higher accuracy
|
| 134 |
-
model = genai.GenerativeModel('gemini-
|
| 135 |
|
| 136 |
# Prompt for the model
|
| 137 |
prompt = "Extract all the Marathi text from this image. Return only the extracted text, do not add markdown or explanations."
|
|
@@ -144,7 +144,7 @@ async def marathi_ocr(file: UploadFile = File(...)):
|
|
| 144 |
return JSONResponse(content={
|
| 145 |
"language": "marathi",
|
| 146 |
"filename": file.filename,
|
| 147 |
-
"source_model": "gemini-
|
| 148 |
"extracted_text": gemini_text,
|
| 149 |
"normalized_text": normalize_marathi_text(gemini_text) # Optional normalization
|
| 150 |
})
|
|
|
|
| 131 |
|
| 132 |
logger.info("Attempting Gemini OCR...")
|
| 133 |
# Using gemini-1.5-flash for speed and efficiency, or use 'gemini-1.5-pro' for higher accuracy
|
| 134 |
+
model = genai.GenerativeModel('gemini-2.5-flash')
|
| 135 |
|
| 136 |
# Prompt for the model
|
| 137 |
prompt = "Extract all the Marathi text from this image. Return only the extracted text, do not add markdown or explanations."
|
|
|
|
| 144 |
return JSONResponse(content={
|
| 145 |
"language": "marathi",
|
| 146 |
"filename": file.filename,
|
| 147 |
+
"source_model": "gemini-2.5-flash",
|
| 148 |
"extracted_text": gemini_text,
|
| 149 |
"normalized_text": normalize_marathi_text(gemini_text) # Optional normalization
|
| 150 |
})
|