File size: 312 Bytes
a41bdbc
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import streamlit as st
from sentence_transformers import SentenceTransformer
from .config import MODELS_ID


@st.cache(allow_output_mutation=True)
def load_model(model_name):
    assert model_name in MODELS_ID.keys()
    # Lazy downloading
    model = SentenceTransformer(MODELS_ID[model_name])
    return model