From c4c7fc4ab34e77642291064880d5a4176de2ac75 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 7 Jan 2024 09:30:55 -0800 Subject: [PATCH] Lint --- extensions/dynatemp_with_range/script.py | 3 ++- modules/sampler_hijack.py | 4 +--- one_click.py | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/extensions/dynatemp_with_range/script.py b/extensions/dynatemp_with_range/script.py index f4b09d4b..158abb06 100644 --- a/extensions/dynatemp_with_range/script.py +++ b/extensions/dynatemp_with_range/script.py @@ -6,6 +6,7 @@ params = { "maximum_temperature": 2, } + def convert_to_dynatemp(): temperature = 0.5 * (params["minimum_temperature"] + params["maximum_temperature"]) dynatemp = params["maximum_temperature"] - temperature @@ -22,7 +23,7 @@ def state_modifier(state): temperature, dynatemp = convert_to_dynatemp() state["temperature"] = temperature - state["dynatemp"] = dynatemp + state["dynatemp"] = dynatemp return state diff --git a/modules/sampler_hijack.py b/modules/sampler_hijack.py index e3edd484..b5524548 100644 --- a/modules/sampler_hijack.py +++ b/modules/sampler_hijack.py @@ -16,7 +16,7 @@ global_scores = None class TemperatureLogitsWarperWithDynatemp(LogitsWarper): - def __init__(self, temperature: float, dynatemp: float, filter_value: float = -float("Inf"), min_tokens_to_keep: int = 1): + def __init__(self, temperature: float, dynatemp: float): if not isinstance(temperature, float) or not (temperature > 0): except_msg = ( f"`temperature` (={temperature}) has to be a strictly positive float, otherwise your next token " @@ -29,8 +29,6 @@ class TemperatureLogitsWarperWithDynatemp(LogitsWarper): self.temperature = temperature self.dynatemp = dynatemp - self.filter_value = filter_value - self.min_tokens_to_keep = min_tokens_to_keep def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor: diff --git a/one_click.py b/one_click.py index 2bd31f72..86d97c6e 100644 --- a/one_click.py +++ b/one_click.py @@ -247,9 +247,9 @@ def install_webui(): if selected_gpu == "INTEL": # Install oneAPI dependencies via conda print_big_message("Installing Intel oneAPI runtime libraries.") - run_cmd(f"conda install -y -c intel dpcpp-cpp-rt=2024.0 mkl-dpcpp=2024.0") + run_cmd("conda install -y -c intel dpcpp-cpp-rt=2024.0 mkl-dpcpp=2024.0") # Install libuv required by Intel-patched torch - run_cmd(f"conda install -y libuv") + run_cmd("conda install -y libuv") # Install the webui requirements update_requirements(initial_installation=True)