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