Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import threading
|
3 |
import time
|
4 |
import subprocess
|
@@ -13,7 +14,7 @@ if not os.path.exists(OLLAMA):
|
|
13 |
|
14 |
def ollama_service_thread():
|
15 |
global process
|
16 |
-
process = subprocess.Popen("~/ollama serve", shell=True)
|
17 |
process.wait()
|
18 |
|
19 |
OLLAMA_SERVICE_THREAD = threading.Thread(target=ollama_service_thread)
|
|
|
1 |
import os
|
2 |
+
import signal
|
3 |
import threading
|
4 |
import time
|
5 |
import subprocess
|
|
|
14 |
|
15 |
def ollama_service_thread():
|
16 |
global process
|
17 |
+
process = subprocess.Popen("~/ollama serve", shell=True, preexec_fn=os.setsid)
|
18 |
process.wait()
|
19 |
|
20 |
OLLAMA_SERVICE_THREAD = threading.Thread(target=ollama_service_thread)
|