opeCLIP-waste-wizard / test_hf_model.py
ysfad's picture
Update app to use HF Hub model and test successful model loading
8f20c1d
raw
history blame contribute delete
732 Bytes
"""Test loading model from Hugging Face Hub."""
import sys
sys.path.append('.')
try:
print("🔄 Testing model download from Hugging Face Hub...")
from clip_waste_classifier.finetuned_classifier import FinetunedCLIPWasteClassifier
classifier = FinetunedCLIPWasteClassifier(hf_model_id='ysfad/openclip-finetune-waste')
model_info = classifier.get_model_info()
print(f"✅ Model loaded successfully!")
print(f"📋 Model type: {model_info['model_type']}")
print(f"🏗️ Architecture: {model_info['model_name']}")
print(f"📊 Classes: {model_info['num_classes']}")
except Exception as e:
print(f"❌ Error: {e}")
print("🔄 Will fallback to pretrained model in production")