diff --git a/fastchat/llm_judge/common.py b/fastchat/llm_judge/common.py index d2640d601..baba272e4 100644 --- a/fastchat/llm_judge/common.py +++ b/fastchat/llm_judge/common.py @@ -454,12 +454,12 @@ def chat_completion_openai_azure(model, conv, temperature, max_tokens, api_dict= ) output = response["choices"][0]["message"]["content"] break - except openai.error.OpenAIError as e: - print(type(e), e) - time.sleep(API_RETRY_SLEEP) except openai.error.InvalidRequestError as e: print(type(e), e) break + except openai.error.OpenAIError as e: + print(type(e), e) + time.sleep(API_RETRY_SLEEP) except KeyError: print(response) break diff --git a/fastchat/serve/gradio_block_arena_anony.py b/fastchat/serve/gradio_block_arena_anony.py index 625c69c44..5e8512c9f 100644 --- a/fastchat/serve/gradio_block_arena_anony.py +++ b/fastchat/serve/gradio_block_arena_anony.py @@ -190,7 +190,11 @@ def share_click(state0, state1, model_selector0, model_selector1, request: gr.Re OUTAGE_MODELS = [] -def get_sample_weight(model, outage_models, sampling_weights, sampling_boost_models=[]): +def get_sample_weight( + model, outage_models, sampling_weights, sampling_boost_models=None +): + if sampling_boost_models is None: + sampling_boost_models = [] if model in outage_models: return 0 weight = sampling_weights.get(model, 0)