Spaces:
Sleeping
Sleeping
Update load_model.py
Browse files- load_model.py +5 -2
load_model.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
import os
|
2 |
-
import
|
3 |
from dotenv import load_dotenv
|
4 |
|
5 |
load_dotenv()
|
|
|
6 |
model_path = os.getenv('MODEL_PATH')
|
7 |
|
8 |
def load_model():
|
9 |
-
|
|
|
|
|
|
1 |
import os
|
2 |
+
import requests
|
3 |
from dotenv import load_dotenv
|
4 |
|
5 |
load_dotenv()
|
6 |
+
api_key = os.getenv('HF_API_KEY')
|
7 |
model_path = os.getenv('MODEL_PATH')
|
8 |
|
9 |
def load_model():
|
10 |
+
# For Hugging Face, loading a model is typically done via an API request rather than locally.
|
11 |
+
headers = {"Authorization": f"Bearer {api_key}"}
|
12 |
+
return headers, model_path
|