File size: 1,228 Bytes
db40417 |
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 29 30 31 32 33 34 35 36 |
#!/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()
|