Circhastic commited on
Commit
bae9232
1 Parent(s): 923595a
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -172,14 +172,14 @@ def sales_growth(dataframe, fittedValues):
172
  # TAPAS Model
173
 
174
  @st.cache_resource
175
- def load_tapas_model(model, tokenizer):
176
  model_name = "google/tapas-large-finetuned-wtq"
177
  tokenizer = TapasTokenizer.from_pretrained(model_name)
178
  model = TapasForQuestionAnswering.from_pretrained(model_name, local_files_only=False)
179
  pipe = pipeline("table-question-answering", model=model, tokenizer=tokenizer)
180
  return pipe
181
 
182
- pipe = load_tapas_model(model, tokenizer)
183
 
184
  def get_answer(table, query):
185
  answers = pipe(table=table, query=query)
 
172
  # TAPAS Model
173
 
174
  @st.cache_resource
175
+ def load_tapas_model():
176
  model_name = "google/tapas-large-finetuned-wtq"
177
  tokenizer = TapasTokenizer.from_pretrained(model_name)
178
  model = TapasForQuestionAnswering.from_pretrained(model_name, local_files_only=False)
179
  pipe = pipeline("table-question-answering", model=model, tokenizer=tokenizer)
180
  return pipe
181
 
182
+ pipe = load_tapas_model()
183
 
184
  def get_answer(table, query):
185
  answers = pipe(table=table, query=query)