File size: 1,885 Bytes
f4e737e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import subprocess #line:1
import threading #line:2
import sys #line:3
import os #line:4
os .environ ['LD_PRELOAD']='/home/studio-lab-user/.conda/envs/default/lib/libtcmalloc_minimal.so.4'#line:6
def zrok_launch (OO0OO0O00OOO00000 ,O0O0O00OO0O0OO00O ):#line:8
    subprocess .run (f"mkdir -p /tmp/models /tmp/Lora /tmp/ControlNet",shell =True ,stdout =subprocess .DEVNULL ,stderr =subprocess .DEVNULL )#line:13
    try :#line:14
        O0O0000O00O000000 =subprocess .Popen (['python','zrok.py',OO0OO0O00OOO00000 ],stdout =subprocess .PIPE ,stderr =subprocess .PIPE ,text =True )#line:15
        O000000OOO000OOOO =subprocess .Popen (['python','main.py']+O0O0O00OO0O0OO00O ,stdout =sys .stdout ,stderr =sys .stdout ,text =True )#line:17
        def OOO0OO000OO0000OO (O00OOOOO0OOOOOOOO ):#line:19
            try :#line:20
                if O00OOOOO0OOOOOOOO .stdout is not None :#line:21
                    for O00000O00O00OOOO0 in O00OOOOO0OOOOOOOO .stdout :#line:22
                        print (O00000O00O00OOOO0 .strip ())#line:23
            except Exception :#line:25
                pass #line:26
        O0O0OO000O00OO000 =threading .Thread (target =OOO0OO000OO0000OO ,args =(O0O0000O00O000000 ,))#line:28
        OO000O000OOO0O0OO =threading .Thread (target =OOO0OO000OO0000OO ,args =(O000000OOO000OOOO ,))#line:29
        O0O0OO000O00OO000 .start ()#line:31
        OO000O000OOO0O0OO .start ()#line:32
        O0O0OO000O00OO000 .join ()#line:34
        OO000O000OOO0O0OO .join ()#line:35
    except KeyboardInterrupt :#line:37
        pass #line:38
    except Exception as O0OO000OO0OOO0OOO :#line:40
        print ("Error:",str (O0OO000OO0OOO0OOO ))#line:41
if __name__ =="__main__":#line:43
    if len (sys .argv )<2 :#line:44
        sys .exit (1 )#line:45
    token =sys .argv [1 ]#line:47
    launch_args =sys .argv [2 :]#line:48
    zrok_launch (token ,launch_args )