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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- 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})
 
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})