Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,6 @@ OLLAMA_SERVICE_THREAD = threading.Thread(target=ollama_service_thread)
|
|
| 21 |
# OLLAMA_SERVICE_THREAD.start()
|
| 22 |
|
| 23 |
def terminate():
|
| 24 |
-
global process
|
| 25 |
if process:
|
| 26 |
os.killpg(os.getpgid(process.pid), signal.SIGTERM)
|
| 27 |
OLLAMA_SERVICE_THREAD.join()
|
|
@@ -84,9 +83,9 @@ def ollama_func(command):
|
|
| 84 |
}
|
| 85 |
if c1 in function_map:
|
| 86 |
function_map.get(c1)
|
| 87 |
-
return [[f"Running {c1}"]]
|
| 88 |
else:
|
| 89 |
-
return [["No supported command."]]
|
| 90 |
|
| 91 |
@spaces.GPU()
|
| 92 |
def launch():
|
|
@@ -100,7 +99,7 @@ def stream_chat(message: str, history: list, model: str, temperature: float, max
|
|
| 100 |
ollama_func(message)
|
| 101 |
else:
|
| 102 |
if not INIT_SIGN:
|
| 103 |
-
return [["Please Enter /init to initialize Ollama"]]
|
| 104 |
else:
|
| 105 |
launch()
|
| 106 |
conversation = []
|
|
|
|
| 21 |
# OLLAMA_SERVICE_THREAD.start()
|
| 22 |
|
| 23 |
def terminate():
|
|
|
|
| 24 |
if process:
|
| 25 |
os.killpg(os.getpgid(process.pid), signal.SIGTERM)
|
| 26 |
OLLAMA_SERVICE_THREAD.join()
|
|
|
|
| 83 |
}
|
| 84 |
if c1 in function_map:
|
| 85 |
function_map.get(c1)
|
| 86 |
+
return [["", f"Running {c1}"]]
|
| 87 |
else:
|
| 88 |
+
return [["", "No supported command."]]
|
| 89 |
|
| 90 |
@spaces.GPU()
|
| 91 |
def launch():
|
|
|
|
| 99 |
ollama_func(message)
|
| 100 |
else:
|
| 101 |
if not INIT_SIGN:
|
| 102 |
+
return [["", "Please Enter /init to initialize Ollama"]]
|
| 103 |
else:
|
| 104 |
launch()
|
| 105 |
conversation = []
|