working-unified-multi-model-pt / usage_example.py
kunaliitkgp09's picture
Add usage example
db40417 verified
raw
history blame
1.23 kB
#!/usr/bin/env python3
# Usage Example for Working Unified Multi-Model .pt file
import torch
from working_complete_unified_model_pt import WorkingUnifiedMultiModelPT
def main():
print("🚀 Working Unified Multi-Model .pt File Usage")
print("=" * 50)
# Load the model from .pt file
print("📂 Loading model from working_unified_multi_model.pt...")
model = WorkingUnifiedMultiModelPT.load_model("working_unified_multi_model.pt")
print("✅ Model loaded successfully!")
# Test different capabilities
test_cases = [
"What is machine learning?",
"Generate an image of a peaceful forest",
"Describe this image: sample_image.jpg",
"Explain how neural networks work step by step"
]
for i, test_input in enumerate(test_cases, 1):
print(f"\n{i}. Input: {test_input}")
result = model.process(test_input)
print(f" Task Type: {result['task_type']}")
print(f" Confidence: {result['confidence']:.2f}")
print(f" Processing Time: {result['processing_time']:.2f}s")
print(f" Output: {result['output'][:100]}...")
print("\n🎉 All tests completed!")
if __name__ == "__main__":
main()