scottlepp commited on
Commit
ef1521b
1 Parent(s): aa5d057
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -21,8 +21,9 @@ def prepare_input(question: str, table: List[str]):
21
  input_ids = tokenizer(inputs, max_length=700, return_tensors="pt").input_ids
22
  return input_ids
23
 
24
- def inference(question: str, table: List[str]) -> str:
25
- input_data = prepare_input(question=question, table=table)
 
26
  input_data = input_data.to(model.device)
27
  outputs = model.generate(inputs=input_data, num_beams=10, top_k=10, max_length=700)
28
  result = tokenizer.decode(token_ids=outputs[0], skip_special_tokens=True)
 
21
  input_ids = tokenizer(inputs, max_length=700, return_tensors="pt").input_ids
22
  return input_ids
23
 
24
+ def inference(question: str, table: str) -> str:
25
+ cols = table.split(",")
26
+ input_data = prepare_input(question=question, table=cols)
27
  input_data = input_data.to(model.device)
28
  outputs = model.generate(inputs=input_data, num_beams=10, top_k=10, max_length=700)
29
  result = tokenizer.decode(token_ids=outputs[0], skip_special_tokens=True)