From 19aa5308cb2defe4207641c5c30f50fb75f28525 Mon Sep 17 00:00:00 2001 From: PYNing <540439329@qq.com> Date: Wed, 10 Jan 2024 10:58:56 +0800 Subject: [PATCH] Kepp code style consistent with PR #1419 --- server/text_generation_server/cli.py | 8 ++++---- server/text_generation_server/models/flash_llama.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/text_generation_server/cli.py b/server/text_generation_server/cli.py index 8624cef7..99be6c7e 100644 --- a/server/text_generation_server/cli.py +++ b/server/text_generation_server/cli.py @@ -198,17 +198,17 @@ def download_weights( if not extension == ".safetensors" or not auto_convert: raise e - elif Path(model_id).joinpath("medusa_lm_head.pt").exists(): + elif (Path(model_id) / "medusa_lm_head.pt").exists(): # Try to load as a local Medusa model try: import json - medusa_head = Path(model_id).joinpath("medusa_lm_head.pt") + medusa_head = Path(model_id) / "medusa_lm_head.pt" if auto_convert: - medusa_sf = Path(model_id).joinpath("medusa_lm_head.safetensors") + medusa_sf = Path(model_id) / "medusa_lm_head.safetensors" if not medusa_sf.exists(): utils.convert_files([Path(medusa_head)], [medusa_sf], []) - medusa_config = Path(model_id).joinpath("config.json") + medusa_config = Path(model_id) / "config.json" with open(medusa_config, "r") as f: config = json.load(f) diff --git a/server/text_generation_server/models/flash_llama.py b/server/text_generation_server/models/flash_llama.py index f94359a8..7be61906 100644 --- a/server/text_generation_server/models/flash_llama.py +++ b/server/text_generation_server/models/flash_llama.py @@ -86,8 +86,8 @@ class FlashLlama(FlashCausalLM): use_medusa, revision=revision, filename="medusa_lm_head.pt" ) else: - medusa_config = str(Path(use_medusa).joinpath("config.json")) - medusa_head = str(Path(use_medusa).joinpath("medusa_lm_head.pt")) + medusa_config = str(Path(use_medusa) / "config.json") + medusa_head = str(Path(use_medusa) / "medusa_lm_head.pt") with open(medusa_config, "r") as f: config = json.load(f)