File size: 1,109 Bytes
931223d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import json
import os

MODEL_DIR = r"D:\oeil d'elephant"

def inspect():
    files = ["config.json", "preprocessor_config.json", "tokenizer_config.json"]
    
    for f in files:
        path = os.path.join(MODEL_DIR, f)
        print(f"\n--- {f} ---")
        if os.path.exists(path):
            try:
                with open(path, 'r', encoding='utf-8') as file:
                    content = json.load(file)
                    # Print summary to avoid huge output
                    if f == "config.json":
                        print(json.dumps({k:v for k,v in content.items() if k in ['architectures', 'model_type', 'logit_scale_init_value', 'vision_config', 'text_config']}, indent=2))
                    elif f == "preprocessor_config.json":
                        print(json.dumps(content, indent=2))
                    else:
                        print(json.dumps(content, indent=2))
            except Exception as e:
                print(f"Error reading {f}: {e}")
        else:
            print("File not found.")

if __name__ == "__main__":
    inspect()