Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/transformers/commands/serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,14 @@ def run(self):
allow_methods=["*"],
allow_headers=["*"],
)
logger.warning(
"WARNING: CORS allow origin is set to `*`. This is not recommended for production environments."
)
else:
logger.warning(
"NOTE: Some apps may require CORS. Consider launching the server with `--enable-cors` if you see "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.warning(
"NOTE: Some apps may require CORS. Consider launching the server with `--enable-cors` if you see "
logger.info(
"Some apps may require CORS. Consider launching the server with `--enable-cors` if you see "

Copy link
Member Author

@gante gante Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info don't get shown by default, and I want this to be shown on transformers serve (otherwise, users will keep getting stuck)

"errors."
)

@app.post("/v1/chat/completions")
def chat_completion(request: dict):
Expand Down