Rik Bose commited on
Commit
3b863fe
·
1 Parent(s): 82e649a

hashing troubles(

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,8 +3,8 @@ import streamlit as st
3
  from transformers import pipeline
4
 
5
  @st.cache
6
- def get_model():
7
- return pipeline("fill-mask", model="roberta-base")
8
 
9
 
10
  text = st.text_input("Enter a sentence. Use a * for a mask.")
@@ -13,7 +13,7 @@ text = st.text_input("Enter a sentence. Use a * for a mask.")
13
 
14
  if text:
15
  data_load_state = st.text('Loading data...')
16
- nlp = get_model()
17
  result = nlp(text.replace("*",nlp.tokenizer.mask_token))
18
  data_load_state.text('Loading data...done!')
19
  for d in result:
 
3
  from transformers import pipeline
4
 
5
  @st.cache
6
+ def get_model(model):
7
+ return pipeline("fill-mask", model=model)
8
 
9
 
10
  text = st.text_input("Enter a sentence. Use a * for a mask.")
 
13
 
14
  if text:
15
  data_load_state = st.text('Loading data...')
16
+ nlp = get_model("roberta-base")
17
  result = nlp(text.replace("*",nlp.tokenizer.mask_token))
18
  data_load_state.text('Loading data...done!')
19
  for d in result: