import json | |
import os | |
# Get the directory where this script is located | |
local_dir = os.path.dirname(os.path.abspath(__file__)) | |
# Load and modify config.json | |
config_path = os.path.join(local_dir, "config.json") | |
with open(config_path, 'r') as f: | |
config = json.load(f) | |
# Example modifications - adjust based on your needs | |
config["custom_parameter"] = "your_value" | |
config["max_length"] = 2048 # Example modification | |
config["temperature"] = 0.7 # Example modification | |
# Add any custom parameters you need | |
config["custom_settings"] = { | |
"modified_by": "your_name", | |
"modification_date": "2024-09-04", | |
"custom_feature": True | |
} | |
# Save the modified config | |
with open(config_path, 'w') as f: | |
json.dump(config, f, indent=2) | |
print("Configuration updated successfully!") |