File size: 598 Bytes
4a6cee0
 
 
 
 
 
 
 
 
 
 
 
 
1f00002
4a6cee0
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import subprocess
import sys

def setup_dependencies():
    os.environ["OMP_NUM_THREADS"] = "4"
    try:
        if os.path.exists('/tmp/deps_installed'):
            return
            
        print("Installing transformers dev version...")
        subprocess.check_call([
            sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-cache-dir",
            "transformers==4.56.0"
        ])
        
        with open('/tmp/deps_installed', 'w') as f:
            f.write('done')
            
    except Exception as e:
        print(f"Dependencies setup error: {e}")