Ransaka commited on
Commit
91aa7e9
·
1 Parent(s): 594ab7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -92,6 +92,7 @@ def get_prompt(mask_token):
92
 
93
  if __name__ == "__main__":
94
  model_id,mask_token = get_model_id()
 
95
  if st.checkbox("Show example"):
96
  show_example()
97
  sentence = get_input_text()
@@ -99,7 +100,7 @@ if __name__ == "__main__":
99
  if sentence:
100
  prompt = get_prompt(mask_token)
101
  if prompt and st.button("Classify"):
102
- pipe = pipeline("fill-mask", model=model_id, token=hf_token)
103
  output = pipe(sentence + prompt, targets=TARGETS, top_k =len(TARGETS))
104
  output = pd.DataFrame(output)
105
  output['score'] = output['score'].apply(lambda x:x/sum(output['score']))
 
92
 
93
  if __name__ == "__main__":
94
  model_id,mask_token = get_model_id()
95
+ pipe = pipeline("fill-mask", model=model_id, token=hf_token)
96
  if st.checkbox("Show example"):
97
  show_example()
98
  sentence = get_input_text()
 
100
  if sentence:
101
  prompt = get_prompt(mask_token)
102
  if prompt and st.button("Classify"):
103
+ # pipe = pipeline("fill-mask", model=model_id, token=hf_token)
104
  output = pipe(sentence + prompt, targets=TARGETS, top_k =len(TARGETS))
105
  output = pd.DataFrame(output)
106
  output['score'] = output['score'].apply(lambda x:x/sum(output['score']))