UCS2014 commited on
Commit
3a94865
·
verified ·
1 Parent(s): 91e1050

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -20,8 +20,17 @@ from matplotlib.ticker import FuncFormatter
20
  import plotly.graph_objects as go
21
  from sklearn.metrics import mean_squared_error
22
 
23
- # NEW: HF Hub downloader
24
- from huggingface_hub import hf_hub_download
 
 
 
 
 
 
 
 
 
25
 
26
  # =========================
27
  # App constants / defaults
 
20
  import plotly.graph_objects as go
21
  from sklearn.metrics import mean_squared_error
22
 
23
+ repo_id = "Smart-Thinking/minstress_model"
24
+ model_file = "minstress_model/minstress_model.joblib"
25
+ meta_file = "minstress_model/minstress_meta.json"
26
+ token = _hf_token() # keep token if repo is private
27
+
28
+ model_path = hf_hub_download(repo_id=repo_id, filename=model_file, token=token)
29
+ model = joblib.load(model_path)
30
+ meta_path = hf_hub_download(repo_id=repo_id, filename=meta_file, token=token)
31
+ with open(meta_path, "r", encoding="utf-8") as f:
32
+ meta = json.load(f)
33
+
34
 
35
  # =========================
36
  # App constants / defaults