debatelab-admin commited on
Commit
148cf69
1 Parent(s): d6a3aba
Files changed (2) hide show
  1. app.py +4 -2
  2. requirements.txt +2 -1
app.py CHANGED
@@ -9,6 +9,7 @@ import requests
9
  import seaborn as sns
10
  import streamlit as st
11
  from spacy import displacy
 
12
  from transformers import pipeline
13
 
14
  import aaac_util as aaac
@@ -272,7 +273,8 @@ def run_model(mode_set, user_input):
272
 
273
 
274
  #inference = build_inference_api()
275
- inference = pipeline(task="text2text-generation", model=MODEL)
 
276
 
277
  current_input = user_input.copy()
278
  output = []
@@ -293,7 +295,7 @@ def run_model(mode_set, user_input):
293
  attempts += 1
294
  try:
295
  # api call
296
- out = inference(inputs, INFERENCE_PARAMS)
297
  if not isinstance(out, list):
298
  raise ValueError('Response is not a list.')
299
  except Exception:
 
9
  import seaborn as sns
10
  import streamlit as st
11
  from spacy import displacy
12
+ from stqdm import stqdm
13
  from transformers import pipeline
14
 
15
  import aaac_util as aaac
 
273
 
274
 
275
  #inference = build_inference_api()
276
+ with st.spinner('Initializing pipeline'):
277
+ inference = pipeline(task="text2text-generation", model=MODEL)
278
 
279
  current_input = user_input.copy()
280
  output = []
 
295
  attempts += 1
296
  try:
297
  # api call
298
+ out = inference(inputs, **INFERENCE_PARAMS)
299
  if not isinstance(out, list):
300
  raise ValueError('Response is not a list.')
301
  except Exception:
requirements.txt CHANGED
@@ -5,4 +5,5 @@ pyparsing==2.4.7
5
  z3-solver==4.8.10.0
6
  transformers
7
  sentencepiece
8
- torch
 
 
5
  z3-solver==4.8.10.0
6
  transformers
7
  sentencepiece
8
+ torch
9
+ stqdm