Spaces:
Sleeping
Sleeping
currency code
Browse files
app.py
CHANGED
|
@@ -41,15 +41,15 @@ def read_root(image_file: bytes = File(...)):
|
|
| 41 |
question_1 = "What is the Total amount?"
|
| 42 |
question_2 = "What is the VAT amount?"
|
| 43 |
question_3 = "What is the Date?"
|
| 44 |
-
question_4 = "What is the
|
| 45 |
output_1 = pipe(image, question_1)
|
| 46 |
output_2 = pipe(image, question_2)
|
| 47 |
output_3 = pipe(image, question_3)
|
| 48 |
output_4 = pipe(image, question_4)
|
| 49 |
|
| 50 |
response = {}
|
| 51 |
-
response['
|
| 52 |
-
response['
|
| 53 |
response['date'] = output_3[0]['answer']
|
| 54 |
-
response['
|
| 55 |
return response
|
|
|
|
| 41 |
question_1 = "What is the Total amount?"
|
| 42 |
question_2 = "What is the VAT amount?"
|
| 43 |
question_3 = "What is the Date?"
|
| 44 |
+
question_4 = "What is the currency code?"
|
| 45 |
output_1 = pipe(image, question_1)
|
| 46 |
output_2 = pipe(image, question_2)
|
| 47 |
output_3 = pipe(image, question_3)
|
| 48 |
output_4 = pipe(image, question_4)
|
| 49 |
|
| 50 |
response = {}
|
| 51 |
+
response['totalAmount'] = output_1[0]['answer']
|
| 52 |
+
response['totalVat'] = output_2[0]['answer']
|
| 53 |
response['date'] = output_3[0]['answer']
|
| 54 |
+
response['currencyCode'] = output_4[0]['answer']
|
| 55 |
return response
|