[Bugfix] remove default sampling parameters (#2173)
This commit is contained in:
1 parent
fb5d8ffd4e
commit
8305477750
4 files changed
+21
-60
No files matched your search
@@ -370,44 +370,6 @@ query_map = {
|
||||
|
||||
def run_multimodal_generation(args, client: OpenAI) -> None:
|
||||
model_name = args.model
|
||||
thinker_sampling_params = {
|
||||
"temperature": 0.4, # Deterministic
|
||||
"top_p": 0.9,
|
||||
"top_k": 1,
|
||||
"max_tokens": 16384,
|
||||
"repetition_penalty": 1.05,
|
||||
"stop_token_ids": [151645], # Qwen EOS token <|im_end|>
|
||||
"seed": SEED,
|
||||
}
|
||||
|
||||
# Sampling parameters for Talker stage (codec generation)
|
||||
# Stop at codec EOS token
|
||||
talker_sampling_params = {
|
||||
"temperature": 0.9,
|
||||
"top_k": 50,
|
||||
"max_tokens": 4096,
|
||||
"seed": SEED,
|
||||
"detokenize": False,
|
||||
"repetition_penalty": 1.05,
|
||||
"stop_token_ids": [2150], # TALKER_CODEC_EOS_TOKEN_ID
|
||||
}
|
||||
|
||||
# # Sampling parameters for Code2Wav stage (audio generation)
|
||||
code2wav_sampling_params = {
|
||||
"temperature": 0.0,
|
||||
"top_p": 1.0,
|
||||
"top_k": -1,
|
||||
"max_tokens": 4096 * 16,
|
||||
"seed": SEED,
|
||||
"detokenize": True,
|
||||
"repetition_penalty": 1.1,
|
||||
}
|
||||
|
||||
sampling_params_list = [
|
||||
thinker_sampling_params,
|
||||
talker_sampling_params,
|
||||
code2wav_sampling_params,
|
||||
]
|
||||
|
||||
# Get paths and custom prompt from args
|
||||
video_path = getattr(args, "video_path", None)
|
||||
@@ -445,8 +407,7 @@ def run_multimodal_generation(args, client: OpenAI) -> None:
|
||||
audio_path=audio_path,
|
||||
)
|
||||
extra_body = {
|
||||
# Optional, it has default settings in stage configs.
|
||||
"sampling_params_list": sampling_params_list
|
||||
# Optional, it has default settings in stage configs. you can override them here.
|
||||
}
|
||||
if args.query_type == "use_audio_in_video":
|
||||
extra_body["mm_processor_kwargs"] = {"use_audio_in_video": True}
|
||||
|
||||
@@ -27,7 +27,7 @@ cd examples/online_serving/qwen2_5_omni
|
||||
#### Send request via python
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py --query-type mixed_modalities --port 8091 --host "localhost"
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py --model Qwen/Qwen2.5-Omni-7B --query-type use_mixed_modalities --port 8091 --host "localhost"
|
||||
```
|
||||
|
||||
The Python client supports the following command-line arguments:
|
||||
@@ -42,11 +42,12 @@ The Python client supports the following command-line arguments:
|
||||
For example, to use mixed modalities with all local files:
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type mixed_modalities \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_mixed_modalities \
|
||||
--video-path /path/to/your/video.mp4 \
|
||||
--image-path /path/to/your/image.jpg \
|
||||
--audio-path /path/to/your/audio.wav \
|
||||
--model Qwen/Qwen2.5-Omni-7B \
|
||||
--prompt "Analyze all the media content and provide a comprehensive summary."
|
||||
```
|
||||
|
||||
@@ -97,8 +98,9 @@ curl http://localhost:8091/v1/chat/completions \
|
||||
### Using Python client
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type mixed_modalities \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_mixed_modalities \
|
||||
--model Qwen/Qwen2.5-Omni-7B \
|
||||
--modalities text
|
||||
```
|
||||
|
||||
@@ -139,8 +141,9 @@ print(response.choices[1].message.audio) # Audio response
|
||||
## Streaming Output
|
||||
If you want to enable streaming output, please set the argument as below. The final output will be obtained just after generated by corresponding stage. Now we only support text streaming output. Other modalities can output normally.
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type mixed_modalities \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_mixed_modalities \
|
||||
--model Qwen/Qwen2.5-Omni-7B \
|
||||
--stream
|
||||
```
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ cd examples/online_serving/qwen3_omni
|
||||
#### Send request via python
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py --query-type use_image --port 8091 --host "localhost"
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py --model Qwen/Qwen3-Omni-30B-A3B-Instruct --query-type use_image --port 8091 --host "localhost"
|
||||
```
|
||||
|
||||
The Python client supports the following command-line arguments:
|
||||
@@ -50,9 +50,10 @@ The Python client supports the following command-line arguments:
|
||||
For example, to use a local video file with custom prompt:
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_video \
|
||||
--video-path /path/to/your/video.mp4 \
|
||||
--model Qwen/Qwen3-Omni-30B-A3B-Instruct \
|
||||
--prompt "What are the main activities shown in this video?"
|
||||
```
|
||||
|
||||
@@ -112,8 +113,9 @@ curl -s http://localhost:8091/v1/chat/completions \
|
||||
### Using Python client
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_image \
|
||||
--model Qwen/Qwen3-Omni-30B-A3B-Instruct \
|
||||
--modalities text
|
||||
```
|
||||
|
||||
@@ -180,9 +182,10 @@ curl http://localhost:8091/v1/chat/completions \
|
||||
Use the `--speaker` argument when generating audio:
|
||||
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_image \
|
||||
--modalities audio \
|
||||
--model Qwen/Qwen3-Omni-30B-A3B-Instruct \
|
||||
--speaker "chelsie"
|
||||
```
|
||||
|
||||
@@ -210,8 +213,9 @@ Supported speaker names depend on the model (e.g. `Ethan`, `Chelsie`, `Aiden`).
|
||||
## Streaming Output
|
||||
If you want to enable streaming output, please set the argument as below. The final output will be obtained just after generated by corresponding stage. Now we only support text streaming output. Other modalities can output normally.
|
||||
```bash
|
||||
python openai_chat_completion_client_for_multimodal_generation.py \
|
||||
python examples/online_serving/openai_chat_completion_client_for_multimodal_generation.py \
|
||||
--query-type use_image \
|
||||
--model Qwen/Qwen3-Omni-30B-A3B-Instruct \
|
||||
--stream
|
||||
```
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ test_params = [
|
||||
common_args = ["python", os.path.join(example_dir, "openai_chat_completion_client_for_multimodal_generation.py")]
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
@@ -82,7 +81,6 @@ def test_send_multimodal_request_001(omni_server) -> None:
|
||||
# TODO: Verify the E2E latency after confirmation baseline.
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
@@ -120,7 +118,6 @@ def test_send_multimodal_request_002(omni_server) -> None:
|
||||
# TODO: Verify the E2E latency after confirmation baseline.
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
@@ -129,7 +126,7 @@ def test_send_multimodal_request_003(omni_server) -> None:
|
||||
command = [
|
||||
"bash",
|
||||
os.path.join(example_dir, "qwen2_5_omni/run_curl_multimodal_generation.sh"),
|
||||
"use_mixed_modalities",
|
||||
"mixed_modalities",
|
||||
]
|
||||
|
||||
result = run_cmd(command)
|
||||
@@ -148,7 +145,6 @@ def test_send_multimodal_request_003(omni_server) -> None:
|
||||
# TODO: Verify the E2E latency after confirmation baseline.
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
@@ -179,7 +175,6 @@ def test_modality_control_001(omni_server) -> None:
|
||||
# TODO: Verify the E2E latency after confirmation baseline.
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
@@ -209,7 +204,6 @@ def test_modality_control_002(omni_server) -> None:
|
||||
# TODO: Verify the E2E latency after confirmation baseline.
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
@@ -248,7 +242,6 @@ def test_modality_control_003(omni_server) -> None:
|
||||
# TODO: Verify the E2E latency after confirmation baseline.
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="issue #2168")
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.omni
|
||||
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||
|
||||
Reference in new issue
Block a user