Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
infwinston committed Dec 29, 2023
1 parent 0920f61 commit 3365cbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions fastchat/serve/api_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ def mistral_api_stream_iter(model_name, messages, temperature, top_p, max_new_to
}
logger.info(f"==== request ====\n{gen_params}")

new_messages = []
for message in messages:
new_messages.append(ChatMessage(role=message["role"], content=message["content"]))
new_messages = [ChatMessage(role=message["role"], content=message["content"]) for message in messages]
new_messages = [
ChatMessage(role=message["role"], content=message["content"])
for message in messages
]

res = client.chat_stream(
model=model_name,
Expand Down
7 changes: 5 additions & 2 deletions fastchat/serve/gradio_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,11 @@ def bot_response(
return

conv, model_name = state.conv, state.model_name
model_api_dict = (openai_compatible_models_info[model_name]
if model_name in openai_compatible_models_info else None)
model_api_dict = (
openai_compatible_models_info[model_name]
if model_name in openai_compatible_models_info
else None
)

if model_api_dict is None:
# Query worker address
Expand Down
2 changes: 1 addition & 1 deletion fastchat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def build_logger(logger_name, logger_filename):
logger.setLevel(logging.INFO)

# Avoid httpx flooding POST logs
logging.getLogger('httpx').setLevel(logging.WARNING)
logging.getLogger("httpx").setLevel(logging.WARNING)

# if LOGDIR is empty, then don't try output log to local file
if LOGDIR != "":
Expand Down

0 comments on commit 3365cbc

Please sign in to comment.