Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -85,9 +85,9 @@ def ollama_func(command):
|
|
85 |
}
|
86 |
if c1 in function_map:
|
87 |
function_map.get(c1)
|
88 |
-
|
89 |
else:
|
90 |
-
|
91 |
|
92 |
@spaces.GPU()
|
93 |
def launch():
|
@@ -98,7 +98,8 @@ def launch():
|
|
98 |
def stream_chat(message: str, history: list, model: str, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
99 |
print(f"message: {message}")
|
100 |
if message.startswith("/"):
|
101 |
-
ollama_func(message)
|
|
|
102 |
else:
|
103 |
if not INIT_SIGN:
|
104 |
yield "Please initialize Ollama"
|
|
|
85 |
}
|
86 |
if c1 in function_map:
|
87 |
function_map.get(c1)
|
88 |
+
return "Running..."
|
89 |
else:
|
90 |
+
return "No supported command."
|
91 |
|
92 |
@spaces.GPU()
|
93 |
def launch():
|
|
|
98 |
def stream_chat(message: str, history: list, model: str, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
99 |
print(f"message: {message}")
|
100 |
if message.startswith("/"):
|
101 |
+
resp = ollama_func(message)
|
102 |
+
yield resp
|
103 |
else:
|
104 |
if not INIT_SIGN:
|
105 |
yield "Please initialize Ollama"
|