GattoNero commited on
Commit
01419cd
·
verified ·
1 Parent(s): 0c08617

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -16
app.py CHANGED
@@ -553,23 +553,11 @@ def create_mock_questions():
553
  "file_name": ""
554
  }
555
  '''
556
- return [
557
- {
558
- 'task_id': '99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3',
559
- 'question': 'Hi, I\'m making a pie but I could use some help with my shopping list. I have everything I need for the crust, but I\'m not sure about the filling. I got the recipe from my friend Aditi, but she left it as a voice memo and the speaker on my phone is buzzing so I can\'t quite make out what she\'s saying. Could you please listen to the recipe and list all of the ingredients that my friend described? I only want the ingredients for the filling, as I have everything I need to make my favorite pie crust. I\'ve attached the recipe as Strawberry pie.mp3.\n\nIn your response, please only list the ingredients, not any measurements. So if the recipe calls for "a pinch of salt" or "two cups of ripe strawberries" the ingredients on the list would be "salt" and "ripe strawberries".\n\nPlease format your response as a comma separated list of ingredients. Also, please alphabetize the ingredients.',
560
- 'Level': '1',
561
- 'file_name': '99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3.mp3'
562
- }
563
- ]
564
 
565
- #return whiteList
566
 
567
  def process_questions(serviceList):
568
  # 1. Rimuovi dalla serviceList tutte le domande i cui task_id sono in blackList
569
-
570
-
571
-
572
-
573
  initial_len = len(serviceList)
574
  serviceList = [q for q in serviceList if q["task_id"] not in blackList]
575
  removed_blacklisted = initial_len - len(serviceList)
@@ -745,7 +733,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
745
  total_questions = response.json()
746
 
747
  print("\n\n")
748
- print(f"total_questions: {total_questions}")
749
  print("\n\n")
750
  questions_data = total_questions[:min(20, len(total_questions))]
751
  print_coso(f"questions_data: {questions_data}")
@@ -777,8 +765,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
777
  try:
778
  file_name = item.get("file_name")
779
  print_coso(f"file_name riga in 3. Run your Agent: {file_name}")
780
- submitted_answer = agent(question_text, file_name) #mock
781
- answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
782
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
783
  except Exception as e:
784
  print(f"Error running agent on task {task_id}: {e}")
 
553
  "file_name": ""
554
  }
555
  '''
556
+ return whiteList
 
 
 
 
 
 
 
557
 
 
558
 
559
  def process_questions(serviceList):
560
  # 1. Rimuovi dalla serviceList tutte le domande i cui task_id sono in blackList
 
 
 
 
561
  initial_len = len(serviceList)
562
  serviceList = [q for q in serviceList if q["task_id"] not in blackList]
563
  removed_blacklisted = initial_len - len(serviceList)
 
733
  total_questions = response.json()
734
 
735
  print("\n\n")
736
+ #print(f"total_questions: {total_questions}")
737
  print("\n\n")
738
  questions_data = total_questions[:min(20, len(total_questions))]
739
  print_coso(f"questions_data: {questions_data}")
 
765
  try:
766
  file_name = item.get("file_name")
767
  print_coso(f"file_name riga in 3. Run your Agent: {file_name}")
768
+ submitted_answer = "mock"#agent(question_text, file_name) #mock
769
+ #answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
770
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
771
  except Exception as e:
772
  print(f"Error running agent on task {task_id}: {e}")