MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / parse_model_from_args

Function parse_model_from_args

llama_cpp/server/cli.py:121–129  ·  view source on GitHub ↗

Parse a pydantic model from an argparse namespace.

(model: T, args: argparse.Namespace)

Source from the content-addressed store, hash-verified

119
120
121def parse_model_from_args(model: T, args: argparse.Namespace) -> T:
122 """Parse a pydantic model from an argparse namespace."""
123 return model(
124 **{
125 k: v
126 for k, v in vars(args).items()
127 if v is not None and k in model.model_fields
128 }
129 )

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…