From 57ba035a61fe2031f175ad043a70d0c6c770c024 Mon Sep 17 00:00:00 2001 From: drbh Date: Wed, 22 May 2024 14:46:29 -0400 Subject: [PATCH] fix: use path inside of speculator config (#1935) This PR access the path on the speculator similar to `MLPSpeculatorHead.load` and `MedusaHeadV1.load` these changes resolves this error locally when loading a `MedusaHeadV2` ``` TypeError: expected str, bytes or os.PathLike object, not dict ``` --- server/text_generation_server/layers/medusa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/text_generation_server/layers/medusa.py b/server/text_generation_server/layers/medusa.py index 2e9a010f..7579ccdb 100644 --- a/server/text_generation_server/layers/medusa.py +++ b/server/text_generation_server/layers/medusa.py @@ -111,10 +111,10 @@ class MedusaHeadV2(nn.Module): from safetensors import safe_open import json - speculator = config.speculator + speculator_path = config.speculator["path"] - medusa_config = str(Path(speculator) / "config.json") - filename = str(Path(speculator) / "medusa_lm_head.safetensors") + medusa_config = str(Path(speculator_path) / "config.json") + filename = str(Path(speculator_path) / "medusa_lm_head.safetensors") with open(medusa_config, "r") as f: medusa_config = json.load(f)