rahul7star commited on
Commit
aefc8e0
·
verified ·
1 Parent(s): e6cd92e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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
- # Download the .pkl file from Hugging Face
13
  model_path = hf_hub_download(
14
  repo_id="rahul7star/fastai-rahul-text-model-v02",
15
- filename="rahul9star_full_learner.pkl" # File name in the repo
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
- # Load the model
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