Spaces:
Sleeping
Sleeping
set gen length etc hyperparam
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ from model import ChatGLMModel#, chat_template
|
|
| 16 |
model = ChatGLMModel()
|
| 17 |
# history = []
|
| 18 |
|
| 19 |
-
max_tokens =
|
| 20 |
temperature = 1.0
|
| 21 |
top_p = 0.7
|
| 22 |
top_k = 50
|
|
@@ -104,8 +104,8 @@ def greet(text):
|
|
| 104 |
docs = [Document(page_content=text)]
|
| 105 |
|
| 106 |
text_splitter = RecursiveCharacterTextSplitter(
|
| 107 |
-
chunk_size=
|
| 108 |
-
chunk_overlap=
|
| 109 |
length_function=len
|
| 110 |
)
|
| 111 |
texts = text_splitter.split_documents(docs)
|
|
|
|
| 16 |
model = ChatGLMModel()
|
| 17 |
# history = []
|
| 18 |
|
| 19 |
+
max_tokens = 2048
|
| 20 |
temperature = 1.0
|
| 21 |
top_p = 0.7
|
| 22 |
top_k = 50
|
|
|
|
| 104 |
docs = [Document(page_content=text)]
|
| 105 |
|
| 106 |
text_splitter = RecursiveCharacterTextSplitter(
|
| 107 |
+
chunk_size=256, # 分割最大尺寸
|
| 108 |
+
chunk_overlap=32, # 重复字数
|
| 109 |
length_function=len
|
| 110 |
)
|
| 111 |
texts = text_splitter.split_documents(docs)
|