Updated Dynamic KV Overrides (markdown)

leafspark 2024-09-04 17:43:35 -07:00
parent 6f8ca6c2db
commit 2e7cdabf07
1 changed files with 41 additions and 14 deletions

@ -1,18 +1,45 @@
Simply use one of these as the text in your `str` override: Simply use one of these as the text in your `str` override (can be used anywhere, and multiple can be used per string):
```python ```python
dynamic_params = { dynamic_params = {
{system.time.milliseconds}": lambda: str(int(time.time() * 1000)), "{system.time.milliseconds}": lambda: str(int(time.time() * 1000)),
{system.time.seconds}": lambda: str(int(time.time())), "{system.time.seconds}": lambda: str(int(time.time())),
{system.date.iso}": lambda: datetime.now().strftime("%Y-%m-%d"), "{system.date.iso}": lambda: datetime.now().strftime("%Y-%m-%d"),
{system.datetime.iso}": lambda: datetime.now().isoformat(), "{system.datetime.iso}": lambda: datetime.now().isoformat(),
{system.username}": lambda: os.getlogin(), "{system.username}": lambda: os.getlogin(),
{system.hostname}": lambda: socket.gethostname(), "{system.hostname}": lambda: socket.gethostname(),
{system.platform}": lambda: platform.system(), "{system.platform}": lambda: platform.system(),
{system.python.version}": lambda: platform.python_version(), "{system.python.version}": lambda: platform.python_version(),
{system.time.milliseconds}": lambda: str(int(time.time() * 1000)), "{system.timezone}": lambda: time.tzname[time.daylight],
{system.date}": lambda: datetime.now().strftime("%Y-%m-%d"), "{system.cpus}": lambda: str(os.cpu_count()),
{model.name}": lambda: model_name if model_name is not None else "Unknown Model", "{system.memory.total}": lambda: str(psutil.virtual_memory().total),
{quant.type}": lambda: quant_type if quant_type is not None else "Unknown Quant", "{system.memory.free}": lambda: str(psutil.virtual_memory().free),
{output.path}": lambda: output_path if output_path is not None else "Unknown Output Path", "{system.filesystem.used}": lambda: str(shutil.disk_usage("/").used),
"{system.kernel.version}": lambda: platform.release(),
"{system.locale}": lambda: locale.getdefaultlocale()[0],
"{process.nice}": lambda: str(os.nice(0)),
"{model.name}": lambda: (
model_name if model_name is not None else "Unknown Model"
),
"{quant.type}": lambda: (
quant_type if quant_type is not None else "Unknown Quant"
),
"{output.path}": lambda: (
output_path if output_path is not None else "Unknown Output Path"
),
"{quant.kv}": lambda: (
quantization_parameters[0]
if quantization_parameters is not None
else False
),
"{quant.requantized}": lambda: (
quantization_parameters[1]
if quantization_parameters is not None
else False
),
"{quant.leave_output_tensor}": lambda: (
quantization_parameters[2]
if quantization_parameters is not None
else False
),
} }
``` ```