File size: 664 Bytes
8acadd7 | 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 | """
Utility functions for creating model configurations.
"""
import argparse
from typing import Dict, Any
def create_model_config(args: argparse.Namespace) -> Dict[str, Any]:
"""
Creates a model configuration dictionary from command-line arguments.
Args:
args: Parsed command-line arguments.
Returns:
A dictionary with model configuration parameters.
"""
model_config = {}
if args.model:
model_config["model_name"] = args.model
if args.temp is not None:
model_config["temperature"] = min(0.25, args.temp)
model_config["precise_temperature"] = min(0.2, args.temp)
return model_config
|