Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,9 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
5 |
# Set the logger to display only CRITICAL messages
|
6 |
logging.basicConfig(level=logging.CRITICAL)
|
7 |
|
|
|
8 |
# Cache the model and tokenizer to avoid reloading it every time
|
9 |
-
@st.
|
10 |
def load_model():
|
11 |
model_name = "Abbeite/chest_and_physical_limitations" # Replace with your actual model name
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
5 |
# Set the logger to display only CRITICAL messages
|
6 |
logging.basicConfig(level=logging.CRITICAL)
|
7 |
|
8 |
+
|
9 |
# Cache the model and tokenizer to avoid reloading it every time
|
10 |
+
@st.experimental_singleton
|
11 |
def load_model():
|
12 |
model_name = "Abbeite/chest_and_physical_limitations" # Replace with your actual model name
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|