Skip to content

Commit 0d3cee7

Browse files
author
zhansheng.lzs
committed
style: replace Chinese comments/docstrings with English
Comment-only cleanup across runtime, tests and examples: translate Chinese # comments and docstrings to English and normalize leftover full-width punctuation in 1.x docstrings. Chinese sample payloads in docstrings (code_generation, conversation, tts_v2, asr) and acli's functional Chinese string tables are intentional data and stay as-is.
1 parent 6a4cb56 commit 0d3cee7

16 files changed

Lines changed: 105 additions & 98 deletions

File tree

‎dashscope/aigc/image_synthesis.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def sync_call(
188188
) -> ImageSynthesisResponse:
189189
"""
190190
Note: This method currently now only supports wan2.2-t2i-flash and wan2.2-t2i-plus. # noqa: E501 # pylint: disable=line-too-long
191-
Using other models will result in an error,More raw image models may be added for use later # pylint: disable=line-too-long
191+
Using other models will result in an error, more raw image models may be added for use later # pylint: disable=line-too-long
192192
"""
193193
if size is not None:
194194
kwargs["size"] = size
@@ -784,7 +784,7 @@ async def sync_call(
784784
) -> ImageSynthesisResponse:
785785
"""
786786
Note: This method currently now only supports wan2.2-t2i-flash and wan2.2-t2i-plus. # noqa: E501 # pylint: disable=line-too-long
787-
Using other models will result in an error,More raw image models may be added for use later # pylint: disable=line-too-long
787+
Using other models will result in an error, more raw image models may be added for use later # pylint: disable=line-too-long
788788
"""
789789
if size is not None:
790790
kwargs["size"] = size

‎dashscope/api_entities/dashscope_response.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class DashScopeAPIResponse(DictMixin):
6969
Args:
7070
request_id (str): The request id.
7171
status_code (int): HTTP status code, 200 indicates that the
72-
request was successful, and others indicate an error。
72+
request was successful, and others indicate an error.
7373
code (str): Error code if error occurs, otherwise empty str.
7474
message (str): Set to error message on error.
7575
output (Any): The request output.

‎dashscope/app/application_response.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545
thought (str, optional): Model's inference thought for doc retrieval or plugin process.
4646
action_type (str, optional): Action type. response : final response; api: to run api calls. # pylint: disable=line-too-long
4747
response (str, optional): Model's results.
48-
action_name (str, optional): Action name, e.g. searchDocument、api.
48+
action_name (str, optional): Action name, e.g. searchDocument, api.
4949
action (str, optional): Code of action, means which plugin or action to be run.
5050
action_input_stream (str, optional): Input param with stream.
5151
action_input (dict, optional): Api or plugin input parameters.

‎dashscope/client/base_api.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ async def wait(
231231
# we start by querying once every second, and double
232232
# the query interval after every 3(increment_steps)
233233
# intervals, until we hit the max waiting interval
234-
# of 5(seconds)
234+
# of 5(seconds)
235235
# (server side return immediately when ready)
236236
if wait_seconds < max_wait_seconds and step % increment_steps == 0:
237237
wait_seconds = min(wait_seconds * 2, max_wait_seconds)
@@ -858,7 +858,7 @@ def wait(
858858
# we start by querying once every second, and double
859859
# the query interval after every 3(increment_steps)
860860
# intervals, until we hit the max waiting interval
861-
# of 5(seconds)
861+
# of 5(seconds)
862862
# TODO: investigate if we can use long-poll
863863
# (server side return immediately when ready)
864864
if wait_seconds < max_wait_seconds and step % increment_steps == 0:

‎dashscope/multimodal/tingwu/tingwu_realtime.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def generate_stop_request(self, direction_name: str) -> str:
444444

445445
def _get_dash_request_header(self, action: str):
446446
"""
447-
:param action: ActionType :run-task, continue-task, finish-task
447+
:param action: ActionType: run-task, continue-task, finish-task
448448
"""
449449
if self.task_id is None:
450450
self.task_id = get_random_uuid()
@@ -534,7 +534,7 @@ def handle_text_response(self, response_json: str):
534534
def handle_binary_response(self, response_binary: bytes):
535535
"""
536536
handle binary response.
537-
:param response_binary: server response binary。
537+
:param response_binary: server response binary.
538538
"""
539539
logger.info(
540540
"<<<<<< server response binary length: %d",

‎dashscope/v2/finetune/reinforcement/examples/workspace/submit_job.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ async def main_workflow():
117117
],
118118
# Function Component Configuration
119119
functions=[
120-
# RolloutFunctionComponent:Environment simulation/rollout
120+
# RolloutFunctionComponent: Environment simulation/rollout
121121
# generation
122122
RolloutFunctionComponent(
123123
name="rollout-1",
@@ -127,7 +127,7 @@ async def main_workflow():
127127
),
128128
runtime=FunctionComponentRuntime(**rollout_runtime),
129129
),
130-
# RewardFunctionComponent:Reward calculation engine
130+
# RewardFunctionComponent: Reward calculation engine
131131
RewardFunctionComponent(
132132
name="reward-1",
133133
weight=1.0,

‎dashscope/v2/resources/audio/customization.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
V2 form of 1.x ``VocabularyService`` (asr hot-word tables,
66
``audio/asr/vocabulary.py``) and ``VoiceEnrollmentService`` (voice
77
cloning, ``audio/tts_v2/enrollment.py``), plus the qwen voice-design
8-
family (声音设计, no 1.x SDK class — modeled from the official REST API).
8+
family (no 1.x SDK class — modeled from the official REST API).
99
All three ride the same envelope: ``POST /services/audio/{asr|tts}/
1010
customization`` with ``{model, input: {action, ...}, parameters?}``;
1111
only the action words and id fields differ per family. 1.x retried
@@ -293,7 +293,7 @@ def delete(
293293

294294

295295
class Voices(_CustomizationBase):
296-
"""``client.audio.voices`` -- voice cloning (声音复刻)."""
296+
"""``client.audio.voices`` -- voice cloning."""
297297

298298
PATH = "/services/audio/tts/customization"
299299
DEFAULT_MODEL = "voice-enrollment"
@@ -453,7 +453,7 @@ def delete(
453453

454454

455455
class VoiceDesign(_CustomizationBase):
456-
"""``client.audio.voice_design`` -- qwen voice design (声音设计).
456+
"""``client.audio.voice_design`` -- qwen voice design.
457457
458458
No 1.x SDK class; modeled from the official REST API, which shares
459459
the voices endpoint with shorter action words and a ``voice`` id

‎dashscope/v2/types/messages.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class TextPart(BaseModel):
3232

3333
type: Literal["text"] = "text"
3434
text: str
35-
# Explicit context-cache marker (Bailian 上下文缓存): a part-level
36-
# sibling such as {"type": "ephemeral"} on the native and
35+
# Explicit context-cache marker (Bailian context caching): a
36+
# part-level sibling such as {"type": "ephemeral"} on the native and
3737
# OpenAI-compatible wires; the cached prefix ends at this part.
3838
# 1.x passed content blocks through unvalidated, so the marker must
3939
# stay accepted on every part type.

‎examples/01_atomic_capabilities/audio/direct_call/realtime_qwen_audio.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
"""Qwen-Audio 单轮实时语音对话:发送 WAV 或麦克风音频,保存并播放回答。"""
2+
"""Single-turn realtime voice chat with Qwen-Audio: send WAV or microphone audio, save and play the reply."""
33

44
import argparse
55
import base64

‎examples/01_atomic_capabilities/audio/realtime_qwen_audio.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
"""Qwen-Audio 单轮实时语音对话:发送 WAV 或麦克风音频,保存并播放回答。"""
2+
"""Single-turn realtime voice chat with Qwen-Audio: send WAV or microphone audio, save and play the reply."""
33

44
import argparse
55
import base64

0 commit comments

Comments
 (0)