Skip to content

Commit

Permalink
check if hm in models before deleting to avoid errors (#2870)
Browse files Browse the repository at this point in the history
Co-authored-by: Your Name <[email protected]>
  • Loading branch information
joshua-ne and Your Name authored Dec 30, 2023
1 parent 4735aa7 commit 722ab02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fastchat/serve/gradio_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ def get_model_list(

hidden_models = ["gpt-4-0314", "gpt-4-0613"]
for hm in hidden_models:
del models[models.index(hm)]
if hm in models:
del models[models.index(hm)]

priority = {k: f"___{i:03d}" for i, k in enumerate(model_info)}
models.sort(key=lambda x: priority.get(x, x))
Expand Down

0 comments on commit 722ab02

Please sign in to comment.