Neon-AI commited on
Commit
c2ec7cc
·
verified ·
1 Parent(s): 779d4ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -15,7 +15,11 @@ HF_TOKEN = st.secrets["HF_TOKEN"] # Put your HF token in Streamlit secrets
15
  st.title("🧠 Niche Trainer with Push to HF")
16
 
17
  # ---------- Load model once ----------
18
- @st.cache_resource(show_spinner=True)
 
 
 
 
19
  def load_model():
20
  tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
21
  model = AutoModelForCausalLM.from_pretrained(
 
15
  st.title("🧠 Niche Trainer with Push to HF")
16
 
17
  # ---------- Load model once ----------
18
+ # DO NOT load on startup
19
+ # tokenizer, model = load_model() <- remove from top
20
+
21
+ # Instead, load when first used:
22
+ @st.cache_resource
23
  def load_model():
24
  tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
25
  model = AutoModelForCausalLM.from_pretrained(