Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,12 @@ def get_y(x): return x['output']
|
|
9 |
# Step 2: Load the model from Hugging Face
|
10 |
def load_model():
|
11 |
try:
|
12 |
-
|
13 |
model_path = hf_hub_download(
|
14 |
repo_id="rahul7star/fastai-rahul-text-model-v02",
|
15 |
-
filename="rahul9star_full_learner.pkl"
|
16 |
)
|
17 |
-
|
18 |
-
# Load the model using FastAI's load_learner method
|
19 |
learn = load_learner(model_path)
|
20 |
print("Model loaded successfully from Hugging Face.")
|
21 |
return learn
|
@@ -23,7 +22,7 @@ def load_model():
|
|
23 |
print(f"Error loading the model: {e}")
|
24 |
return None
|
25 |
|
26 |
-
|
27 |
learn = load_model()
|
28 |
|
29 |
# Check if the model is loaded successfully
|
|
|
9 |
# Step 2: Load the model from Hugging Face
|
10 |
def load_model():
|
11 |
try:
|
12 |
+
|
13 |
model_path = hf_hub_download(
|
14 |
repo_id="rahul7star/fastai-rahul-text-model-v02",
|
15 |
+
filename="rahul9star_full_learner.pkl"
|
16 |
)
|
17 |
+
|
|
|
18 |
learn = load_learner(model_path)
|
19 |
print("Model loaded successfully from Hugging Face.")
|
20 |
return learn
|
|
|
22 |
print(f"Error loading the model: {e}")
|
23 |
return None
|
24 |
|
25 |
+
|
26 |
learn = load_model()
|
27 |
|
28 |
# Check if the model is loaded successfully
|