OCR-Chandra-2-V1 commited on
Commit
4d2bbec
·
verified ·
1 Parent(s): 524b71f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -28,12 +28,11 @@ async def ocr(
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
- context=context if context.strip() else None
35
- )]
36
- result = generate_hf(batch, model, langs=langs)[0]
37
  markdown = parse_markdown(result.raw)
38
 
39
  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})