remove the clone method as it's twice the size?

This commit is contained in:
deep1
2023-04-22 20:03:16 +08:00
parent 97b92b6b22
commit 2ee7f5d5ee
2 changed files with 18 additions and 58 deletions
+18 -18
View File
@@ -1,23 +1,23 @@
{ {
"peacock.color": "#8d5a0f", "peacock.color": "#8d5a0f",
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"activityBar.activeBackground": "#369e23", "activityBar.activeBackground": "#cfc5e4",
"activityBar.background": "#369e23", "activityBar.background": "#cfc5e4",
"activityBar.foreground": "#e7e7e7", "activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#e7e7e799", "activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#2e47d1", "activityBarBadge.background": "#b88167",
"activityBarBadge.foreground": "#e7e7e7", "activityBarBadge.foreground": "#15202b",
"commandCenter.border": "#e7e7e799", "commandCenter.border": "#15202b99",
"sash.hoverBorder": "#369e23", "sash.hoverBorder": "#cfc5e4",
"statusBar.background": "#28741a", "statusBar.background": "#b3a2d4",
"statusBar.foreground": "#e7e7e7", "statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#369e23", "statusBarItem.hoverBackground": "#967fc4",
"statusBarItem.remoteBackground": "#28741a", "statusBarItem.remoteBackground": "#b3a2d4",
"statusBarItem.remoteForeground": "#e7e7e7", "statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#28741a", "titleBar.activeBackground": "#b3a2d4",
"titleBar.activeForeground": "#e7e7e7", "titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#28741a99", "titleBar.inactiveBackground": "#b3a2d499",
"titleBar.inactiveForeground": "#e7e7e799" "titleBar.inactiveForeground": "#15202b99"
}, },
"peacock.remoteColor": "#28741a" "peacock.remoteColor": "#b3a2d4"
} }
-40
View File
@@ -1,40 +0,0 @@
'''
clones models from Hugging Face to models/model-name.
Example:
python clone-model.py facebook/opt-1.3b
this seems nicer than the previous script https://github.com/oobabooga/text-generation-webui/blob/main/download-model.py
'''
from git import Repo
import argparse
import os
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('MODEL', type=str, default=None, help="`tloen/alpaca-lora-7b`")
parser.add_argument('-b', '--branch', type=str, default='main', help='Name of the Git branch to download from.')
parser.add_argument('-t', '--text_only', action='store_true')
args = parser.parse_args()
if __name__ == '__main__':
model = args.MODEL
repo = 'https://huggingface.co/' + model
name = model.replace('/', '_')
output_folder = './data/loras' if 'lora' in name else './data/models'
dest = f'{output_folder}/{name}_git'
if args.text_only:
os.environ['GIT_LFS_SKIP_SMUDGE']="1"
result = subprocess.run(['git', 'lfs'], capture_output=True)
assert result.returncode==0, 'git lfs should be installed'
print(f'cloning "{repo}" to "{dest}"')
Repo.clone_from(repo, dest, multi_options=['--depth=1', '--branch=main', '--filter=blob:none'])
# FIXME it clones the git folder that has a huge size, it seems to have the old git lfs objects. so it's double the size. I can't seem to stop that