File size: 942 Bytes
34d9398
 
 
fca3ef1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from catboost import CatBoostClassifier
import os

def verify_model():
    model_path = os.path.join(os.getcwd(), "catboost_model.bin")
    print(f"Model path: {model_path}")
    print(f"Current working directory: {os.getcwd()}")
    print(f"File exists: {os.path.exists(model_path)}")
    if os.path.exists(model_path):
        print(f"File size: {os.path.getsize(model_path)}")
        
        model = CatBoostClassifier()
        formats = [None, 'binary', 'binnar', 'json']
        
        for fmt in formats:
            try:
                if fmt is None:
                    model.load_model(model_path)
                else:
                    model.load_model(model_path, format=fmt)
                print(f"Successfully loaded model with format: {fmt}")
                return
            except Exception as e:
                print(f"Failed to load with format {fmt}: {str(e)}")

if __name__ == "__main__":
    verify_model()