Spaces:
Running
Running
Istvan-Adem
commited on
Commit
·
2ae9761
1
Parent(s):
48aca94
add original text
Browse files- ocr/api/message/schemas.py +1 -1
- ocr/api/message/views.py +1 -1
ocr/api/message/schemas.py
CHANGED
@@ -3,4 +3,4 @@ from pydantic import BaseModel
|
|
3 |
|
4 |
class OcrResponse(BaseModel):
|
5 |
text: str
|
6 |
-
|
|
|
3 |
|
4 |
class OcrResponse(BaseModel):
|
5 |
text: str
|
6 |
+
originalText: str
|
ocr/api/message/views.py
CHANGED
@@ -21,6 +21,6 @@ async def get_all_chat_messages(
|
|
21 |
raise HTTPException(status_code=400, detail='Unsupported file type.')
|
22 |
text_content = extract_text_from_images(images)
|
23 |
response = await generate_report(text_content)
|
24 |
-
return OcrResponseWrapper(data=OcrResponse(text=clean_response(response)))
|
25 |
finally:
|
26 |
await file.close()
|
|
|
21 |
raise HTTPException(status_code=400, detail='Unsupported file type.')
|
22 |
text_content = extract_text_from_images(images)
|
23 |
response = await generate_report(text_content)
|
24 |
+
return OcrResponseWrapper(data=OcrResponse(text=clean_response(response), originalText=text_content))
|
25 |
finally:
|
26 |
await file.close()
|