Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,9 +36,10 @@ def sum_chain_l1(text, p_bar):
|
|
36 |
for i in p_bar(range(len(text)//8000+1)):
|
37 |
t = text[i*8000:i*8000+8196]
|
38 |
if len(t) > 0:
|
39 |
-
for answer in pipeline.
|
40 |
chatglm_cpp.ChatMessage(role="user",
|
41 |
-
content=prompt+t)
|
|
|
42 |
yield f"{'='*8} {i+1}/{len(text)//8000+1} {'='*8}\n{answer}"
|
43 |
docs.append(answer)
|
44 |
yield docs
|
@@ -48,9 +49,10 @@ def sum_chain_l2_deprecated(docs, p_bar):
|
|
48 |
i = 0
|
49 |
for doc in p_bar(docs[1:]):
|
50 |
i += 1
|
51 |
-
for answer in pipeline.
|
52 |
chatglm_cpp.ChatMessage(role="user",
|
53 |
-
content=prompt+"\n"+hist+"\n"+doc)
|
|
|
54 |
yield f"{'='*8} {i}/{len(docs)} {'='*8}\n{answer}"
|
55 |
hist = answer
|
56 |
yield hist
|
|
|
36 |
for i in p_bar(range(len(text)//8000+1)):
|
37 |
t = text[i*8000:i*8000+8196]
|
38 |
if len(t) > 0:
|
39 |
+
for answer in pipeline.chat(
|
40 |
chatglm_cpp.ChatMessage(role="user",
|
41 |
+
content=prompt+t),
|
42 |
+
stream=True):
|
43 |
yield f"{'='*8} {i+1}/{len(text)//8000+1} {'='*8}\n{answer}"
|
44 |
docs.append(answer)
|
45 |
yield docs
|
|
|
49 |
i = 0
|
50 |
for doc in p_bar(docs[1:]):
|
51 |
i += 1
|
52 |
+
for answer in pipeline.chat(
|
53 |
chatglm_cpp.ChatMessage(role="user",
|
54 |
+
content=prompt+"\n"+hist+"\n"+doc),
|
55 |
+
stream=True):
|
56 |
yield f"{'='*8} {i}/{len(docs)} {'='*8}\n{answer}"
|
57 |
hist = answer
|
58 |
yield hist
|