namnh113 commited on
Commit
359f142
·
1 Parent(s): 7f0063b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -21,10 +21,13 @@ class Chatbot():
21
  'API key (not necessary for now)',
22
  type='password',
23
  help="Type in your HuggingFace API key to use this app")
 
 
 
24
 
25
  self.checkpoint = st.sidebar.selectbox(
26
  label = "Choose model",
27
- options = [model_checkpoint],
28
  help="List available model to predict"
29
  )
30
 
@@ -107,8 +110,6 @@ class Chatbot():
107
  st.error(e, icon="🚨")
108
 
109
  model = Chatbot()
110
- login(token=os.environ['hf_api_key'])
111
- model_checkpoint = 'namnh113/vi-mrc-large'
112
- tokenizer = transformers.AutoTokenizer.from_pretrained(model_checkpoint)
113
- model = MRCQuestionAnswering.from_pretrained(model_checkpoint)
114
  model.form_data()
 
21
  'API key (not necessary for now)',
22
  type='password',
23
  help="Type in your HuggingFace API key to use this app")
24
+
25
+ login(token=os.environ['hf_api_key'])
26
+ self.model_checkpoint = 'namnh113/vi-mrc-large'
27
 
28
  self.checkpoint = st.sidebar.selectbox(
29
  label = "Choose model",
30
+ options = [self.model_checkpoint],
31
  help="List available model to predict"
32
  )
33
 
 
110
  st.error(e, icon="🚨")
111
 
112
  model = Chatbot()
113
+ tokenizer = transformers.AutoTokenizer.from_pretrained(model.model_checkpoint)
114
+ model = MRCQuestionAnswering.from_pretrained(model.model_checkpoint)
 
 
115
  model.form_data()