vilarin commited on
Commit
6952a60
·
verified ·
1 Parent(s): d925e47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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)