Skip to content

Commit

Permalink
Merge pull request #1 from Erland366/fix/studio
Browse files Browse the repository at this point in the history
Fix/studio
  • Loading branch information
danielhanchen authored Nov 4, 2024
2 parents cefce2a + 44f4e43 commit e4665b7
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions unsloth_studio/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,42 @@
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 5 minutes ...")

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",
"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)
upgrade_huggingface_hub.wait()


from huggingface_hub import snapshot_download
import warnings
Expand All @@ -52,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()


Expand Down

0 comments on commit e4665b7

Please sign in to comment.