rosemariafontana commited on
Commit
cdcfcc9
Β·
verified Β·
1 Parent(s): 76c000c

i also apparently cant remember my variable names

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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 = [doc_qa(q["question"], q["context"]) for q in questions]
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']