co-po-bloom-api / test_load.py
MakPr016
Fixed Modeel
3435694
raw
history blame contribute delete
730 Bytes
import os
import sys
from sentence_transformers import SentenceTransformer
print("Testing model loading...")
# Construct path
model_path = os.path.join(os.path.dirname(__file__), "..", "co_po_bloom_model_v3_finetuned")
model_path = os.path.abspath(model_path)
print(f"Target model path: {model_path}")
# Check if path exists
if os.path.exists(model_path):
print(f"Path exists. Contents: {os.listdir(model_path)}")
else:
print("Path does NOT exist!")
try:
print("Attempting to load model...")
model = SentenceTransformer(
model_path,
trust_remote_code=False
)
print("Success!")
except Exception as e:
print(f"Error loading model: {e}")
import traceback
traceback.print_exc()