hysts HF staff commited on
Commit
18da135
1 Parent(s): 60ca629

optimize_install (#7)

Browse files

- refine pip install to avoid download git lfs data (f4be71ac60e823e1b2c6df1c904e225936c0ec8f)
- Update (f02d5474bf3cb91b520d544a932b7ebe97fc657a)

Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -15,9 +15,11 @@ from huggingface_hub import snapshot_download
15
  if os.getenv('SYSTEM') == 'spaces':
16
  subprocess.run(shlex.split('pip uninstall -y modelscope'))
17
  subprocess.run(
18
- shlex.split(
19
- 'pip install git+https://github.com/modelscope/modelscope@fe67395')
20
- )
 
 
21
 
22
  from modelscope.outputs import OutputKeys
23
  from modelscope.pipelines import pipeline
 
15
  if os.getenv('SYSTEM') == 'spaces':
16
  subprocess.run(shlex.split('pip uninstall -y modelscope'))
17
  subprocess.run(
18
+ shlex.split('git clone https://github.com/modelscope/modelscope'),
19
+ cwd='/tmp',
20
+ env={'GIT_LFS_SKIP_SMUDGE': '1'})
21
+ subprocess.run(shlex.split('git checkout fe67395'), cwd='/tmp/modelscope')
22
+ subprocess.run(shlex.split('pip install .'), cwd='/tmp/modelscope')
23
 
24
  from modelscope.outputs import OutputKeys
25
  from modelscope.pipelines import pipeline