Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,11 +28,11 @@ async def ocr(
|
|
| 28 |
contents = await file.read()
|
| 29 |
image = Image.open(io.BytesIO(contents)).convert("RGB")
|
| 30 |
|
| 31 |
-
batch = [BatchInputItem(
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
)]
|
| 35 |
-
result = generate_hf(batch, model, langs=langs, context=context if context.strip() else None)[0]
|
| 36 |
markdown = parse_markdown(result.raw)
|
| 37 |
|
| 38 |
return JSONResponse({"markdown": markdown})
|
|
|
|
| 28 |
contents = await file.read()
|
| 29 |
image = Image.open(io.BytesIO(contents)).convert("RGB")
|
| 30 |
|
| 31 |
+
batch = [BatchInputItem(
|
| 32 |
+
image=image,
|
| 33 |
+
prompt_type=prompt_type
|
| 34 |
+
)]
|
| 35 |
+
result = generate_hf(batch, model, langs=langs, context=context if context.strip() else None)[0]
|
| 36 |
markdown = parse_markdown(result.raw)
|
| 37 |
|
| 38 |
return JSONResponse({"markdown": markdown})
|