From 03a7ce45b6b917b4fb3e212173f73783fd264b75 Mon Sep 17 00:00:00 2001 From: Erland366 Date: Tue, 22 Oct 2024 22:38:45 +0400 Subject: [PATCH 1/4] Update chat.py to include uninstall command for 'unsloth' package --- unsloth_studio/chat.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/unsloth_studio/chat.py b/unsloth_studio/chat.py index 013870f..2a3bfc1 100644 --- a/unsloth_studio/chat.py +++ b/unsloth_studio/chat.py @@ -25,11 +25,20 @@ install_first = [ "pip", "install", - "huggingface_hub", "hf_transfer", "triton", + "unsloth" ] + install_first = subprocess.Popen(install_first) install_first.wait() +uninstall_install_first = [ + "pip", "uninstall", "-y", + "unsloth" +] + +uninstall_install_first = subprocess.Popen(uninstall_install_first) +uninstall_install_first.wait() + install_second = [ "pip", "install", "gradio", From 096e7eaecefa4426aefad9559a23a402cc6c347a Mon Sep 17 00:00:00 2001 From: Erland366 Date: Tue, 22 Oct 2024 22:56:33 +0400 Subject: [PATCH 2/4] Update chat.py to specify gradio version and add upgrade command for huggingface-hub --- unsloth_studio/chat.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/unsloth_studio/chat.py b/unsloth_studio/chat.py index 2a3bfc1..5d4da22 100644 --- a/unsloth_studio/chat.py +++ b/unsloth_studio/chat.py @@ -41,10 +41,21 @@ install_second = [ "pip", "install", - "gradio", + "gradio==4.44.1", "unsloth[colab-new]@git+https://github.com/unslothai/unsloth.git", ] install_second = subprocess.Popen(install_second) +install_second.wait() + +upgrade_huggingface_hub = [ + "pip", "install", + "huggingface-hub", + "-U", + "--force-reinstall" +] + +upgrade_huggingface_hub = subprocess.Popen(upgrade_huggingface_hub) + from huggingface_hub import snapshot_download import warnings From 3c8c5bcef9e1cbd9fc6baae2613642019fced221 Mon Sep 17 00:00:00 2001 From: Erland366 Date: Tue, 22 Oct 2024 23:09:22 +0400 Subject: [PATCH 3/4] Update chat.py to extend installation wait time and remove unnecessary installation steps --- unsloth_studio/chat.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/unsloth_studio/chat.py b/unsloth_studio/chat.py index 5d4da22..0c0adb3 100644 --- a/unsloth_studio/chat.py +++ b/unsloth_studio/chat.py @@ -21,7 +21,7 @@ os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" MODEL_NAME = "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit" -print("Installing packages for 🦥 Unsloth Studio ... Please wait 1 minute ...") +print("Installing packages for 🦥 Unsloth Studio ... Please wait 3 minute ...") install_first = [ "pip", "install", @@ -55,6 +55,7 @@ ] upgrade_huggingface_hub = subprocess.Popen(upgrade_huggingface_hub) +upgrade_huggingface_hub.wait() from huggingface_hub import snapshot_download @@ -72,14 +73,6 @@ disable_progress_bars() snapshot_download(repo_id = MODEL_NAME, repo_type = "model") -install_second.wait() - -install_dependencies = [ - "pip", "install", "--no-deps", - "xformers", "trl", "peft", "accelerate", "bitsandbytes", -] -install_dependencies = subprocess.Popen(install_dependencies) -install_dependencies.wait() clear_output() From 44f4e43e320eb267c56c8e9411ffb59e8ccb6b4c Mon Sep 17 00:00:00 2001 From: Erland366 Date: Tue, 22 Oct 2024 23:20:07 +0400 Subject: [PATCH 4/4] Update chat.py to extend installation wait time from 3 to 5 minutes --- unsloth_studio/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth_studio/chat.py b/unsloth_studio/chat.py index 0c0adb3..a1d8dc5 100644 --- a/unsloth_studio/chat.py +++ b/unsloth_studio/chat.py @@ -21,7 +21,7 @@ os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" MODEL_NAME = "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit" -print("Installing packages for 🦥 Unsloth Studio ... Please wait 3 minute ...") +print("Installing packages for 🦥 Unsloth Studio ... Please wait 5 minutes ...") install_first = [ "pip", "install",