From 9b3a3d8f12d3d4f2157965a203e3d0469cf90ec9 Mon Sep 17 00:00:00 2001 From: hronoas Date: Mon, 18 Nov 2024 17:59:52 +0300 Subject: [PATCH 1/3] openai extension fix: Handle Multiple Content Items in Messages (#6528) --- extensions/openai/completions.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/extensions/openai/completions.py b/extensions/openai/completions.py index 6bd8f409..2cefc22b 100644 --- a/extensions/openai/completions.py +++ b/extensions/openai/completions.py @@ -143,21 +143,20 @@ def convert_history(history): new_history = [] for entry in history: if isinstance(entry['content'], list): - image_url = None - content = None for item in entry['content']: if not isinstance(item, dict): continue - + + image_url = None + content = None if item['type'] == 'image_url' and isinstance(item['image_url'], dict): image_url = item['image_url']['url'] elif item['type'] == 'text' and isinstance(item['text'], str): content = item['text'] - - if image_url: - new_history.append({"image_url": image_url, "role": "user"}) - if content: - new_history.append({"content": content, "role": "user"}) + if image_url: + new_history.append({"image_url": image_url, "role": "user"}) + if content: + new_history.append({"content": content, "role": "user"}) else: new_history.append(entry) From f93196e3065a997fafad7fff503ddf0c96169798 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:00:24 -0300 Subject: [PATCH 2/3] Update accelerate requirement from ==1.0.* to ==1.1.* (#6515) --- requirements.txt | 2 +- requirements_amd.txt | 2 +- requirements_amd_noavx2.txt | 2 +- requirements_apple_intel.txt | 2 +- requirements_apple_silicon.txt | 2 +- requirements_cpu_only.txt | 2 +- requirements_cpu_only_noavx2.txt | 2 +- requirements_noavx2.txt | 2 +- requirements_nowheels.txt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index eb2c8ea8..27aad7a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* bitsandbytes==0.44.* colorama datasets diff --git a/requirements_amd.txt b/requirements_amd.txt index f8980191..63b00a38 100644 --- a/requirements_amd.txt +++ b/requirements_amd.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops diff --git a/requirements_amd_noavx2.txt b/requirements_amd_noavx2.txt index 4c5d7574..1a16ed0e 100644 --- a/requirements_amd_noavx2.txt +++ b/requirements_amd_noavx2.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops diff --git a/requirements_apple_intel.txt b/requirements_apple_intel.txt index aad1f59e..74e3041a 100644 --- a/requirements_apple_intel.txt +++ b/requirements_apple_intel.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops diff --git a/requirements_apple_silicon.txt b/requirements_apple_silicon.txt index 52d5c7bc..42975d20 100644 --- a/requirements_apple_silicon.txt +++ b/requirements_apple_silicon.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops diff --git a/requirements_cpu_only.txt b/requirements_cpu_only.txt index 9a1ccc8d..dd7039e2 100644 --- a/requirements_cpu_only.txt +++ b/requirements_cpu_only.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops diff --git a/requirements_cpu_only_noavx2.txt b/requirements_cpu_only_noavx2.txt index 7ffdc718..c39d788f 100644 --- a/requirements_cpu_only_noavx2.txt +++ b/requirements_cpu_only_noavx2.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops diff --git a/requirements_noavx2.txt b/requirements_noavx2.txt index 57fa41f4..140d92f6 100644 --- a/requirements_noavx2.txt +++ b/requirements_noavx2.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* bitsandbytes==0.44.* colorama datasets diff --git a/requirements_nowheels.txt b/requirements_nowheels.txt index f5c3966e..44d58995 100644 --- a/requirements_nowheels.txt +++ b/requirements_nowheels.txt @@ -1,4 +1,4 @@ -accelerate==1.0.* +accelerate==1.1.* colorama datasets einops From 1c937dad72dfcd176bdc1f25938585e91a48d3d3 Mon Sep 17 00:00:00 2001 From: mefich Date: Mon, 18 Nov 2024 20:01:40 +0500 Subject: [PATCH 3/3] Filter whitespaces in downloader fields in model tab (#6518) --- modules/ui_model_menu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ui_model_menu.py b/modules/ui_model_menu.py index f87b680a..34d58177 100644 --- a/modules/ui_model_menu.py +++ b/modules/ui_model_menu.py @@ -260,6 +260,8 @@ def download_model_wrapper(repo_id, specific_file, progress=gr.Progress(), retur yield ("Please enter a model path") return + repo_id = repo_id.strip() + specific_file = specific_file.strip() downloader = importlib.import_module("download-model").ModelDownloader() progress(0.0)