kcarnold commited on
Commit
da2d88d
1 Parent(s): 206be88

wrong old streamlit api

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,11 +13,11 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
13
  from transformers import MarianMTModel, MarianTokenizer
14
  model_name = 'Helsinki-NLP/opus-mt-ROMANCE-en'
15
 
16
- @st.cache
17
  def get_tokenizer(model_name):
18
  return MarianTokenizer.from_pretrained(model_name)
19
 
20
- @st.cache
21
  def get_model(model_name):
22
  return MarianMTModel.from_pretrained(model_name).to(device)
23
 
 
13
  from transformers import MarianMTModel, MarianTokenizer
14
  model_name = 'Helsinki-NLP/opus-mt-ROMANCE-en'
15
 
16
+ @st.experimental_singleton
17
  def get_tokenizer(model_name):
18
  return MarianTokenizer.from_pretrained(model_name)
19
 
20
+ @st.experimental_singleton
21
  def get_model(model_name):
22
  return MarianMTModel.from_pretrained(model_name).to(device)
23