mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-12-06 07:12:10 +01:00
SuperboogaV2: minor update to avoid json serialization errors #6945
This commit is contained in:
parent
987505ead3
commit
99bd66445f
|
|
@ -292,6 +292,8 @@ class ChromaCollector():
|
||||||
|
|
||||||
for doc in documents:
|
for doc in documents:
|
||||||
doc_tokens = encode(doc)[0]
|
doc_tokens = encode(doc)[0]
|
||||||
|
if isinstance(doc_tokens, np.ndarray):
|
||||||
|
doc_tokens = doc_tokens.tolist()
|
||||||
doc_token_count = len(doc_tokens)
|
doc_token_count = len(doc_tokens)
|
||||||
if current_token_count + doc_token_count > max_token_count:
|
if current_token_count + doc_token_count > max_token_count:
|
||||||
# If adding this document would exceed the max token count,
|
# If adding this document would exceed the max token count,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue