ranimeree commited on
Commit
3b173d8
·
verified ·
1 Parent(s): c274c95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -1,21 +1,15 @@
1
  import gradio as gr
2
  import pandas as pd
3
- import mlflow
4
  import numpy as np
5
  import os
 
6
 
7
  # Load the model - for Hugging Face deployment
8
  try:
9
- # Get absolute path to current directory
10
- current_dir = os.getcwd()
11
- print(f"Loading model from: {current_dir}")
12
-
13
- # List all files to verify
14
- print("Available files:", os.listdir(current_dir))
15
-
16
- # Load model from current directory
17
- model = mlflow.sklearn.load_model(current_dir)
18
  print("Model loaded successfully")
 
19
 
20
  except Exception as e:
21
  print(f"Error loading model: {str(e)}")
 
1
  import gradio as gr
2
  import pandas as pd
 
3
  import numpy as np
4
  import os
5
+ import joblib # Change to joblib for direct loading
6
 
7
  # Load the model - for Hugging Face deployment
8
  try:
9
+ # Load model directly from python_model.pkl
10
+ model = joblib.load("python_model.pkl")
 
 
 
 
 
 
 
11
  print("Model loaded successfully")
12
+ print("Model type:", type(model))
13
 
14
  except Exception as e:
15
  print(f"Error loading model: {str(e)}")