MCPcopy Index your code
hub / github.com/mudler/LocalAI / _parse_options

Function _parse_options

backend/python/ace-step/backend.py:82–99  ·  view source on GitHub ↗

Parse repeated 'key:value' options into a dict. Coerce numeric and bool.

(opts_list)

Source from the content-addressed store, hash-verified

80
81
82def _parse_options(opts_list):
83 """Parse repeated 'key:value' options into a dict. Coerce numeric and bool."""
84 out = {}
85 for opt in opts_list or []:
86 if ":" not in opt:
87 continue
88 key, value = opt.split(":", 1)
89 key = key.strip()
90 value = value.strip()
91 if _is_int(value):
92 out[key] = int(value)
93 elif _is_float(value):
94 out[key] = float(value)
95 elif value.lower() in ("true", "false"):
96 out[key] = value.lower() == "true"
97 else:
98 out[key] = value
99 return out
100
101
102def _generate_audio_sync(servicer, payload, dst_path):

Callers 1

LoadModelMethod · 0.70

Calls 2

_is_intFunction · 0.85
_is_floatFunction · 0.85

Tested by

no test coverage detected