Skip to content

Commit 2fe2869

Browse files
authored
Fix import error "cannot import name 'AlgorithmConfig'" (#103)
Summary: `llama-stack-client` was broken. ``` llama-stack-client Traceback (most recent call last): File "/opt/homebrew/Caskroom/miniconda/base/envs/llama-stack/bin/llama-stack-client", line 5, in <module> from llama_stack_client.lib.cli.llama_stack_client import main File "/opt/homebrew/Caskroom/miniconda/base/envs/llama-stack/lib/python3.10/site-packages/llama_stack_client/lib/cli/llama_stack_client.py", line 23, in <module> from .post_training import post_training File "/opt/homebrew/Caskroom/miniconda/base/envs/llama-stack/lib/python3.10/site-packages/llama_stack_client/lib/cli/post_training/__init__.py", line 7, in <module> from .post_training import post_training File "/opt/homebrew/Caskroom/miniconda/base/envs/llama-stack/lib/python3.10/site-packages/llama_stack_client/lib/cli/post_training/post_training.py", line 12, in <module> from llama_stack_client.types.post_training_supervised_fine_tune_params import ( ImportError: cannot import name 'AlgorithmConfig' from 'llama_stack_client.types.post_training_supervised_fine_tune_params' (/opt/homebrew/Caskroom/miniconda/base/envs/llama-stack/lib/python3.10/site-packages/llama_stack_client/types/post_training_supervised_fine_tune_params.py) (llama-stack) [25-01-28 16:18:41 1738109921] ``` Test Plan: * Checkout this rev * pip install . * Run the command `` Output ``` llama-stack-client Usage: llama-stack-client [OPTIONS] COMMAND [ARGS]... Welcome to the LlamaStackClient CLI Options: --version Show the version and exit. --endpoint TEXT Llama Stack distribution endpoint --api-key TEXT Llama Stack distribution API key --config TEXT Path to config file --help Show this message and exit. Commands: configure Configure Llama Stack Client CLI datasets Query details about available datasets on Llama... eval Run evaluation tasks eval_tasks Query details about available eval tasks type on... inference Query details about available inference endpoints on... inspect Query details about available versions on Llama... models Query details about available models on Llama Stack... post_training Query details about available post_training... providers Query details about available providers on Llama... scoring_functions Manage scoring functions shields Query details about available safety shields on... toolgroups Query details about available toolgroups on Llama... vector_dbs Query details about available vector dbs on... ```
1 parent 2cc1782 commit 2fe2869

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/llama_stack_client/lib/cli/post_training/post_training.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from rich.console import Console
1111

1212
from llama_stack_client.types.post_training_supervised_fine_tune_params import (
13-
AlgorithmConfig, TrainingConfig)
13+
AlgorithmConfigParam, TrainingConfig)
1414

1515
from ..common.utils import handle_client_errors
1616

@@ -35,7 +35,7 @@ def supervised_fine_tune(
3535
ctx,
3636
job_uuid: str,
3737
model: str,
38-
algorithm_config: AlgorithmConfig,
38+
algorithm_config: AlgorithmConfigParam,
3939
training_config: TrainingConfig,
4040
checkpoint_dir: Optional[str],
4141
):

0 commit comments

Comments
 (0)