Update app.py
Browse files
app.py
CHANGED
@@ -83,10 +83,10 @@ def ollama_func(command):
|
|
83 |
"/bye": terminate(),
|
84 |
}
|
85 |
if c1 in function_map:
|
86 |
-
function_map
|
87 |
-
return [f"Running {
|
88 |
else:
|
89 |
-
return ["No supported command."]
|
90 |
|
91 |
@spaces.GPU()
|
92 |
def launch():
|
@@ -95,12 +95,12 @@ def launch():
|
|
95 |
time.sleep(10)
|
96 |
|
97 |
def stream_chat(message: str, history: list, model: str, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
98 |
-
|
99 |
if message.startswith("/"):
|
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 = []
|
|
|
83 |
"/bye": terminate(),
|
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():
|
|
|
95 |
time.sleep(10)
|
96 |
|
97 |
def stream_chat(message: str, history: list, model: str, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
98 |
+
print(f"message: {message}")
|
99 |
if message.startswith("/"):
|
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 = []
|