Andrei Sferdian commited on
Commit
02c8bca
·
1 Parent(s): b249147

Use batch to run tasks

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -87,13 +87,14 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
87
  print(f"Skipping item with missing task_id or question: {item}")
88
  continue
89
  try:
90
- response = agent.invoke(
91
  {
92
  "messages": [
93
  HumanMessage(content=question_text),
94
  ],
95
  },
96
  config={
 
97
  "callbacks": [langfuse_handler],
98
  },
99
  )
 
87
  print(f"Skipping item with missing task_id or question: {item}")
88
  continue
89
  try:
90
+ response = agent.batch(
91
  {
92
  "messages": [
93
  HumanMessage(content=question_text),
94
  ],
95
  },
96
  config={
97
+ "max_concurrency": 1,
98
  "callbacks": [langfuse_handler],
99
  },
100
  )