|
|
|
|
|
|
|
import torch |
|
from working_complete_unified_model_pt import WorkingUnifiedMultiModelPT |
|
|
|
def main(): |
|
print("🚀 Working Unified Multi-Model .pt File Usage") |
|
print("=" * 50) |
|
|
|
|
|
print("📂 Loading model from working_unified_multi_model.pt...") |
|
model = WorkingUnifiedMultiModelPT.load_model("working_unified_multi_model.pt") |
|
print("✅ Model loaded successfully!") |
|
|
|
|
|
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() |
|
|