mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
llama distribution -> llama stack + containers (WIP)
This commit is contained in:
parent
45987996c4
commit
fd3b65b718
16 changed files with 204 additions and 80 deletions
|
@ -47,7 +47,7 @@ def get_dependencies(
|
|||
|
||||
return Dependencies(
|
||||
docker_image=provider.docker_image,
|
||||
pip_packages=pip_packages + SERVER_DEPENDENCIES
|
||||
pip_packages=pip_packages + SERVER_DEPENDENCIES,
|
||||
)
|
||||
|
||||
|
||||
|
@ -161,18 +161,29 @@ class ApiBuild(Subcommand):
|
|||
},
|
||||
**provider_deps,
|
||||
}
|
||||
with open(package_file, "w") as f:
|
||||
|
||||
# properly handle the case where package exists but has
|
||||
# inconsistent configuration for the providers. if possible,
|
||||
# we don't want to overwrite the existing configuration.
|
||||
if package_file.exists():
|
||||
cprint(
|
||||
f"Build `{package_name}` exists; will reconfigure",
|
||||
color="yellow",
|
||||
)
|
||||
c = PackageConfig(**yaml.safe_load(package_file.read_text()))
|
||||
else:
|
||||
c = PackageConfig(
|
||||
built_at=datetime.now(),
|
||||
package_name=package_name,
|
||||
docker_image=(
|
||||
package_name if args.type == BuildType.container.value else None
|
||||
),
|
||||
conda_env=(
|
||||
package_name if args.type == BuildType.conda_env.value else None
|
||||
),
|
||||
providers=stub_config,
|
||||
)
|
||||
|
||||
c.docker_image = (
|
||||
package_name if args.type == BuildType.container.value else None
|
||||
)
|
||||
c.conda_env = package_name if args.type == BuildType.conda_env.value else None
|
||||
|
||||
with open(package_file, "w") as f:
|
||||
to_write = json.loads(json.dumps(c.dict(), cls=EnumEncoder))
|
||||
f.write(yaml.dump(to_write, sort_keys=False))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue