Spaces:
Runtime error
Runtime error
i also apparently cant remember my variable names
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ def parse_ticket_image(image, question):
|
|
| 14 |
|
| 15 |
questions = [
|
| 16 |
{"question": "What is the ticket number?", "context": image},
|
|
|
|
| 17 |
{"question": "What is the date?", "context": image},
|
| 18 |
{"question": "What is the time?", "context": image},
|
| 19 |
{"question": "What is the gross weight?", "context": image},
|
|
@@ -28,7 +29,7 @@ def parse_ticket_image(image, question):
|
|
| 28 |
]
|
| 29 |
|
| 30 |
# Use the model to answer each question
|
| 31 |
-
results = [
|
| 32 |
|
| 33 |
# Extract answers from the results
|
| 34 |
ticket_number = results[0][0]['answer']
|
|
|
|
| 14 |
|
| 15 |
questions = [
|
| 16 |
{"question": "What is the ticket number?", "context": image},
|
| 17 |
+
{"question": "What is the type of grain (For example: corn, soy, wheat)?", "context": image},
|
| 18 |
{"question": "What is the date?", "context": image},
|
| 19 |
{"question": "What is the time?", "context": image},
|
| 20 |
{"question": "What is the gross weight?", "context": image},
|
|
|
|
| 29 |
]
|
| 30 |
|
| 31 |
# Use the model to answer each question
|
| 32 |
+
results = [model(q["question"], q["context"]) for q in questions]
|
| 33 |
|
| 34 |
# Extract answers from the results
|
| 35 |
ticket_number = results[0][0]['answer']
|