davidberenstein1957 HF staff commited on
Commit
a4aa9e7
1 Parent(s): ce7c64b

fix: batching logic

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -52,11 +52,10 @@ def process_records_gradio(records, fields, question, example_records=None):
52
  task.set_runtime_parameters(runtime_parameters)
53
 
54
  results = []
55
- print(records[0])
56
  output = task.process(inputs=[{"record": record} for record in records])
57
-
58
- for _ in records:
59
- entry = next(output)[0]
60
  if entry["suggestions"]:
61
  results.append(entry["suggestions"])
62
 
 
52
  task.set_runtime_parameters(runtime_parameters)
53
 
54
  results = []
 
55
  output = task.process(inputs=[{"record": record} for record in records])
56
+ output = next(output)
57
+ for idx in range(len(records)):
58
+ entry = output[idx]
59
  if entry["suggestions"]:
60
  results.append(entry["suggestions"])
61