HaggiVaggi commited on
Commit
afdd144
·
1 Parent(s): a11e339

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -21,7 +21,7 @@ def embedding_and_index():
21
 
22
  embeddings_array, index = embedding_and_index()
23
 
24
- @st.cache(allow_output_mutation=True)
25
  def load_tokenizer_and_model():
26
  tokenizer = AutoTokenizer.from_pretrained("DeepPavlov/rubert-base-cased-sentence")
27
  model = AutoModel.from_pretrained("DeepPavlov/rubert-base-cased-sentence")
@@ -29,7 +29,7 @@ def load_tokenizer_and_model():
29
 
30
  tokenizer, model = load_tokenizer_and_model()
31
 
32
- @st.cache(allow_output_mutation=True)
33
  def encode_description(description, tokenizer, model):
34
  tokens = tokenizer(description, return_tensors="pt")
35
  with torch.no_grad():
 
21
 
22
  embeddings_array, index = embedding_and_index()
23
 
24
+ @st.cache_resource
25
  def load_tokenizer_and_model():
26
  tokenizer = AutoTokenizer.from_pretrained("DeepPavlov/rubert-base-cased-sentence")
27
  model = AutoModel.from_pretrained("DeepPavlov/rubert-base-cased-sentence")
 
29
 
30
  tokenizer, model = load_tokenizer_and_model()
31
 
32
+ @st.cache_resource
33
  def encode_description(description, tokenizer, model):
34
  tokens = tokenizer(description, return_tensors="pt")
35
  with torch.no_grad():