mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
Fix lint
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
parent
ef214cbfc0
commit
188aef8fa2
4 changed files with 8 additions and 9 deletions
|
@ -293,13 +293,12 @@ class StackBuild(Subcommand):
|
||||||
|
|
||||||
if template_name:
|
if template_name:
|
||||||
# copy run.yaml from template to build_dir instead of generating it again
|
# copy run.yaml from template to build_dir instead of generating it again
|
||||||
template_path = pkg_resources.resource_filename(
|
template_path = (
|
||||||
"llama_stack", f"templates/{template_name}/run.yaml"
|
importlib.resources.files("llama_stack")
|
||||||
|
/ f"templates/{template_name}/run.yaml"
|
||||||
)
|
)
|
||||||
os.makedirs(build_dir, exist_ok=True)
|
with importlib.resources.as_file(template_path) as path:
|
||||||
run_config_file = build_dir / f"{build_config.name}-run.yaml"
|
shutil.copy(path, run_config_file)
|
||||||
shutil.copy(template_path, run_config_file)
|
|
||||||
|
|
||||||
# Find all ${env.VARIABLE} patterns
|
# Find all ${env.VARIABLE} patterns
|
||||||
cprint("Build Successful!", color="green")
|
cprint("Build Successful!", color="green")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -52,6 +52,7 @@ class StackRun(Subcommand):
|
||||||
|
|
||||||
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from llama_stack.distribution.build import ImageType
|
from llama_stack.distribution.build import ImageType
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
# This source code is licensed under the terms described in the LICENSE file in
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
# the root directory of this source tree.
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import importlib.resources
|
||||||
import logging
|
import logging
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import importlib.resources
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from termcolor import cprint
|
from termcolor import cprint
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,12 @@
|
||||||
# This source code is licensed under the terms described in the LICENSE file in
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
# the root directory of this source tree.
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import importlib.resources
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any, Dict, Optional
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
import importlib.resources
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue