Spaces:
Sleeping
Sleeping
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() | |