Fix model config loading in shared.py for Python 3.13 (#6961)

This commit is contained in:
Downtown-Case 2025-05-06 15:03:33 -05:00 committed by GitHub
parent c4f36db0d8
commit 5ef564a22e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -310,11 +310,13 @@ if args.api or args.public_api:
add_extension('openai', last=True)
# Load model-specific settings
with Path(f'{args.model_dir}/config.yaml') as p:
if p.exists():
model_config = yaml.safe_load(open(p, 'r').read())
else:
model_config = {}
p = Path(f'{args.model_dir}/config.yaml')
if p.exists():
model_config = yaml.safe_load(open(p, 'r').read())
else:
model_config = {}
del p
# Load custom model-specific settings
user_config = load_user_config()