Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from pathlib import Path
|
|
5 |
import chatglm_cpp
|
6 |
import gradio as gr
|
7 |
|
|
|
8 |
class myChatMessage(chatglm_cpp.ChatMessage):
|
9 |
def __deepcopy__(self, memo):
|
10 |
return myChatMessage(self.role, self.content)
|
@@ -41,8 +42,8 @@ DEFAULT_MODEL_PATH = "./chatglm3-ggml-q4_0.bin"
|
|
41 |
parser = argparse.ArgumentParser()
|
42 |
parser.add_argument("-m", "--model", default=DEFAULT_MODEL_PATH, type=Path, help="model path")
|
43 |
parser.add_argument("--mode", default="chat", type=str, choices=["chat", "generate"], help="inference mode")
|
44 |
-
parser.add_argument("-l", "--max_length", default=
|
45 |
-
parser.add_argument("-c", "--max_context_length", default=
|
46 |
parser.add_argument("--top_k", default=0, type=int, help="top-k sampling")
|
47 |
parser.add_argument("--top_p", default=0.7, type=float, help="top-p sampling")
|
48 |
parser.add_argument("--temp", default=0.95, type=float, help="temperature")
|
|
|
5 |
import chatglm_cpp
|
6 |
import gradio as gr
|
7 |
|
8 |
+
|
9 |
class myChatMessage(chatglm_cpp.ChatMessage):
|
10 |
def __deepcopy__(self, memo):
|
11 |
return myChatMessage(self.role, self.content)
|
|
|
42 |
parser = argparse.ArgumentParser()
|
43 |
parser.add_argument("-m", "--model", default=DEFAULT_MODEL_PATH, type=Path, help="model path")
|
44 |
parser.add_argument("--mode", default="chat", type=str, choices=["chat", "generate"], help="inference mode")
|
45 |
+
parser.add_argument("-l", "--max_length", default=8192, type=int, help="max total length including prompt and output")
|
46 |
+
parser.add_argument("-c", "--max_context_length", default=2048, type=int, help="max context length")
|
47 |
parser.add_argument("--top_k", default=0, type=int, help="top-k sampling")
|
48 |
parser.add_argument("--top_p", default=0.7, type=float, help="top-p sampling")
|
49 |
parser.add_argument("--temp", default=0.95, type=float, help="temperature")
|