-
Notifications
You must be signed in to change notification settings - Fork 978
[Debug] Enable curl retry aligned with openai #1539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,10 +160,7 @@ esac | |
| echo "Running query type: $QUERY_TYPE" | ||
| echo "" | ||
|
|
||
|
|
||
| output=$(curl -sS -X POST http://localhost:8091/v1/chat/completions \ | ||
| -H "Content-Type: application/json" \ | ||
| -d @- <<EOF | ||
| request_body=$(cat <<EOF | ||
| { | ||
| "model": "Qwen/Qwen2.5-Omni-7B", | ||
| "sampling_params_list": $sampling_params_list, | ||
|
|
@@ -186,7 +183,12 @@ output=$(curl -sS -X POST http://localhost:8091/v1/chat/completions \ | |
| ] | ||
| } | ||
| EOF | ||
| ) | ||
| ) | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good: Proper HTTP status code extraction Using The logic correctly checks for 2xx status codes (200-299) as success. |
||
| output=$(curl -sS --retry 3 --retry-delay 3 --retry-connrefused \ | ||
| -X POST http://localhost:8091/v1/chat/completions \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$request_body") | ||
|
|
||
| # Here it only shows the text content of the first choice. Audio content has many binaries, so it's not displayed here. | ||
| echo "Output of request: $(echo "$output" | jq '.choices[0].message.content')" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,10 +138,7 @@ esac | |
| echo "Running query type: $QUERY_TYPE" | ||
| echo "" | ||
|
|
||
|
|
||
| output=$(curl -sS -X POST http://localhost:8091/v1/chat/completions \ | ||
| -H "Content-Type: application/json" \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good: Consistent implementation The retry logic is identical between the Qwen2.5-Omni and Qwen3-Omni scripts, which is good for maintainability. Same suggestions apply here as for the Qwen2.5-Omni script. |
||
| -d @- <<EOF | ||
| request_body=$(cat <<EOF | ||
| { | ||
| "model": "Qwen/Qwen3-Omni-30B-A3B-Instruct", | ||
| "sampling_params_list": $sampling_params_list, | ||
|
|
@@ -164,7 +161,12 @@ output=$(curl -sS -X POST http://localhost:8091/v1/chat/completions \ | |
| ] | ||
| } | ||
| EOF | ||
| ) | ||
| ) | ||
|
|
||
| output=$(curl -sS --retry 3 --retry-delay 3 --retry-connrefused \ | ||
| -X POST http://localhost:8091/v1/chat/completions \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$request_body") | ||
|
|
||
| # Here it only shows the text content of the first choice. Audio content has many binaries, so it's not displayed here. | ||
| echo "Output of request: $(echo "$output" | jq '.choices[0].message.content')" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good: Configurable retry parameters
Defining
MAX_RETRIESandRETRY_DELAYas variables makes it easy to adjust the retry behavior if needed.Suggestion: Consider making these configurable via environment variables:
This would allow CI or users to override the defaults without modifying the script.