Spaces:
Sleeping
Sleeping
deployed v1.0.1
Browse files
app.py
CHANGED
@@ -6,10 +6,13 @@ import matplotlib.pyplot as plt
|
|
6 |
import seaborn as sns
|
7 |
from scipy.interpolate import make_interp_spline
|
8 |
import numpy as np
|
|
|
|
|
|
|
9 |
|
10 |
def load_model(repo_id, filename):
|
11 |
-
#
|
12 |
-
model_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
13 |
# 使用joblib加载模型
|
14 |
model = joblib.load(model_path)
|
15 |
return model
|
|
|
6 |
import seaborn as sns
|
7 |
from scipy.interpolate import make_interp_spline
|
8 |
import numpy as np
|
9 |
+
import os
|
10 |
+
|
11 |
+
hf_token = os.getenv("HF_TOKEN")
|
12 |
|
13 |
def load_model(repo_id, filename):
|
14 |
+
# 使用环境变量中的HF_TOKEN下载模型文件
|
15 |
+
model_path = hf_hub_download(repo_id=repo_id, filename=filename, use_auth_token=hf_token)
|
16 |
# 使用joblib加载模型
|
17 |
model = joblib.load(model_path)
|
18 |
return model
|