Skip to content

Commit 9e5e44c

Browse files
Merge pull request #129 from luk384090-cloud/main
Dev/CLI Refactor
2 parents 50ce021 + f34b360 commit 9e5e44c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

dashscope/cli/fine_tunes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _dump_logs(job_id: str):
121121
output = ensure_ok(rsp)
122122
for line in output["logs"]:
123123
console.print(line, highlight=False)
124-
if output["total"] < LOG_PAGE_SIZE:
124+
if len(output["total"]) < LOG_PAGE_SIZE:
125125
break
126126
offset += LOG_PAGE_SIZE
127127

dashscope/cli/oss.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import typer
77

8+
import dashscope
89
from dashscope.utils.oss_utils import OssUtils
910
from dashscope.cli.common import console, error, success
1011

@@ -56,7 +57,9 @@ def upload(
5657
if not os.path.exists(file_path):
5758
error(f"File {file_path} does not exist")
5859

59-
resolved_key = api_key or os.environ.get("DASHSCOPE_API_KEY")
60+
resolved_key = (
61+
api_key or dashscope.api_key or os.environ.get("DASHSCOPE_API_KEY")
62+
)
6063
if not resolved_key:
6164
error(
6265
"Please set your DashScope API key as environment variable "

0 commit comments

Comments
 (0)