rahul7star commited on
Commit
3157e2e
·
verified ·
1 Parent(s): f0744ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,15 +1,14 @@
1
  import gradio as gr
2
- import torch
3
  from fastai.text.all import load_learner
4
  from huggingface_hub import hf_hub_download
5
 
6
  # Step 8: Download the model from Hugging Face and load it
7
  def load_model():
8
  try:
9
- # Download the model .pth file from Hugging Face
10
  model_path = hf_hub_download(
11
  repo_id="rahul7star/fastai-rahul-text-model-v02",
12
- filename="model1.pth"
13
  )
14
 
15
  # Load the model using FastAI's load_learner method
@@ -20,7 +19,7 @@ def load_model():
20
  print(f"Error loading the model: {e}")
21
  return None
22
 
23
- # Load the model (this will be run at the start)
24
  learn = load_model()
25
 
26
  # Check if the model is loaded successfully
 
1
  import gradio as gr
 
2
  from fastai.text.all import load_learner
3
  from huggingface_hub import hf_hub_download
4
 
5
  # Step 8: Download the model from Hugging Face and load it
6
  def load_model():
7
  try:
8
+ # Download the model .pkl file from Hugging Face
9
  model_path = hf_hub_download(
10
  repo_id="rahul7star/fastai-rahul-text-model-v02",
11
+ filename="rahul9star.pkl"
12
  )
13
 
14
  # Load the model using FastAI's load_learner method
 
19
  print(f"Error loading the model: {e}")
20
  return None
21
 
22
+ # Load the model
23
  learn = load_model()
24
 
25
  # Check if the model is loaded successfully