-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathverify_loading.py
More file actions
49 lines (36 loc) · 1.21 KB
/
verify_loading.py
File metadata and controls
49 lines (36 loc) · 1.21 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
import sys
import os
from pathlib import Path
# Add the repo root to sys.path
repo_root = Path(__file__).resolve().parent
sys.path.append(str(repo_root))
import importlib
main_module = importlib.import_module("llms.main")
# Mock g_app since it's used in ExtensionContext
class MockApp:
def __init__(self):
self.all_providers = []
self.aspect_ratios = {}
self.server_add_get = []
self.server_add_post = []
self.ui_extensions = []
main_module.g_app = MockApp()
main_module._ROOT = repo_root / "llms" # Set _ROOT manually as it's set in main() normally
print(f"ROOT: {main_module._ROOT}")
try:
main_module.load_builtin_extensions()
found_chutes = False
for provider in main_module.g_app.all_providers:
if provider.__name__ == "ChutesImage":
found_chutes = True
print("SUCCESS: ChutesImage provider found!")
break
if not found_chutes:
print("FAILURE: ChutesImage provider NOT found.")
print(f"Providers found: {[p.__name__ for p in main_module.g_app.all_providers]}")
sys.exit(1)
except Exception as e:
print(f"An error occurred: {e}")
import traceback
traceback.print_exc()
sys.exit(1)