File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212if __name__ == "__main__" :
1313 parser = argparse .ArgumentParser ()
14+ parser .add_argument (
15+ "--hostname" ,
16+ type = str ,
17+ default = "127.0.0.1" ,
18+ help = "Which host name to run the server on." ,
19+ )
1420 parser .add_argument (
1521 "--port" ,
16- "-p" ,
1722 type = int ,
1823 default = 8000 ,
1924 help = "Which port to run the server on." ,
2328 cert_path = os .path .join (lib_path , "cert.pem" )
2429 key_path = os .path .join (lib_path , "key.pem" )
2530
26- host = "127.0.0.1"
27- port = 8000 if not args .port else args .port
31+ print (args )
32+ host = args .hostname
33+ port = args .port
34+
2835 httpd = http .server .HTTPServer ((host , port ), http .server .SimpleHTTPRequestHandler )
2936
3037 context = ssl .SSLContext (ssl .PROTOCOL_TLS_SERVER )
3138 context .load_cert_chain (certfile = cert_path , keyfile = key_path )
3239
3340 httpd .socket = context .wrap_socket (httpd .socket , server_side = True )
34- print (f"HTTPS server started @ https://127.0.0.1 :{ port } " )
41+ print (f"HTTPS server started @ https://{ host } :{ port } " )
3542 httpd .serve_forever ()
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ export BPY="$BPY_BIN/python3"
1212export BPIP=" $BPY_BIN /python3 -m pip"
1313export BVENV=" $BPY_BIN /activate"
1414
15- LD_LIBRARY_PATH=$( " $BPY " -c ' import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))' )
16- export LD_LIBRARY_PATH
15+ # LD_LIBRARY_PATH=$("$BPY" -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))')
16+ # export LD_LIBRARY_PATH
1717
1818# Bashful Python
1919function bpy() {
@@ -36,7 +36,7 @@ function bpy.http() {
3636function bpy.https() {
3737 lib_dir=" $BASHFUL_DIR /python/libs/https"
3838 lib_main=" main.py"
39- bpy " $lib_dir /$lib_main "
39+ bpy " $lib_dir /$lib_main " " $@ "
4040}
4141
4242# Simple Local Only (GPU and/or CPU) LLM runner
You can’t perform that action at this time.
0 commit comments