20 lines
531 B
Python
Executable File
20 lines
531 B
Python
Executable File
import argparse
|
|
import yaml
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser(description="Model Training and Testing")
|
|
parser.add_argument(
|
|
"--config", type=str, required=True, help="Path to the configuration file"
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
# Load YAML configuration
|
|
if args.config:
|
|
with open(args.config, "r") as file:
|
|
config = yaml.safe_load(file)
|
|
else:
|
|
raise ValueError("Configuration file path must be provided using --config")
|
|
|
|
return config
|