forked from phoenix-oss/llama-stack-mirror
Switch to use importlib instead of deprecated pkg_resources (#678)
`pkg_resources` has been deprecated. This PR switches to use `importlib.resources`. --------- Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
parent
747683a8a2
commit
9ec54dcbe7
5 changed files with 43 additions and 45 deletions
|
@ -52,7 +52,8 @@ class StackRun(Subcommand):
|
|||
)
|
||||
|
||||
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
|
||||
import pkg_resources
|
||||
import importlib.resources
|
||||
|
||||
import yaml
|
||||
|
||||
from llama_stack.distribution.build import ImageType
|
||||
|
@ -107,15 +108,15 @@ class StackRun(Subcommand):
|
|||
config = parse_and_maybe_upgrade_config(config_dict)
|
||||
|
||||
if config.docker_image:
|
||||
script = pkg_resources.resource_filename(
|
||||
"llama_stack",
|
||||
"distribution/start_container.sh",
|
||||
script = (
|
||||
importlib.resources.files("llama_stack")
|
||||
/ "distribution/start_container.sh"
|
||||
)
|
||||
run_args = [script, config.docker_image]
|
||||
else:
|
||||
script = pkg_resources.resource_filename(
|
||||
"llama_stack",
|
||||
"distribution/start_conda_env.sh",
|
||||
script = (
|
||||
importlib.resources.files("llama_stack")
|
||||
/ "distribution/start_conda_env.sh"
|
||||
)
|
||||
run_args = [
|
||||
script,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue