Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,6 +76,7 @@ def ollama_func(command):
|
|
| 76 |
c1, c2 = command.split(" ")
|
| 77 |
else:
|
| 78 |
c1 = command
|
|
|
|
| 79 |
function_map = {
|
| 80 |
"/init": init(),
|
| 81 |
"/pull": ollama.pull(c2),
|
|
@@ -84,9 +85,9 @@ def ollama_func(command):
|
|
| 84 |
}
|
| 85 |
if c1 in function_map:
|
| 86 |
function_map.get(c1)
|
| 87 |
-
|
| 88 |
else:
|
| 89 |
-
|
| 90 |
|
| 91 |
@spaces.GPU()
|
| 92 |
def launch():
|
|
@@ -100,7 +101,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 |
-
|
| 104 |
else:
|
| 105 |
launch()
|
| 106 |
conversation = []
|
|
|
|
| 76 |
c1, c2 = command.split(" ")
|
| 77 |
else:
|
| 78 |
c1 = command
|
| 79 |
+
c2 = ""
|
| 80 |
function_map = {
|
| 81 |
"/init": init(),
|
| 82 |
"/pull": ollama.pull(c2),
|
|
|
|
| 85 |
}
|
| 86 |
if c1 in function_map:
|
| 87 |
function_map.get(c1)
|
| 88 |
+
yield "Running..."
|
| 89 |
else:
|
| 90 |
+
yield "No supported command."
|
| 91 |
|
| 92 |
@spaces.GPU()
|
| 93 |
def launch():
|
|
|
|
| 101 |
ollama_func(message)
|
| 102 |
else:
|
| 103 |
if not INIT_SIGN:
|
| 104 |
+
yield "Please initialize Ollama"
|
| 105 |
else:
|
| 106 |
launch()
|
| 107 |
conversation = []
|