fix: fix infinite recursion

This commit is contained in:
Joan Martinez 2024-05-07 18:14:33 +02:00
parent d9e29036aa
commit 043f298775
2 changed files with 6 additions and 9 deletions

View file

@ -16,17 +16,10 @@ Feature: llama.cpp server
Then the server is starting
Then the server is healthy
Scenario: Embedding
When embeddings are computed for:
"""
What is the capital of Bulgaria ?
"""
Then embeddings are generated
Scenario: Tokenize / Detokenize complex
When tokenizing:
"""
España is a èspciâl café über naïve résumé cañón élite cañas Barça
España is your's mine's l'heure èspciâl café über naïve résumé cañón élite cañas Barça
"""
Then tokens can be detokenize and is equivalent False

View file

@ -496,7 +496,11 @@ std::vector<uint32_t> canonical_decomposition_cpts(std::vector<uint32_t> & cpts,
if (it.first != it.second) {
uint offset = 0;
for (auto jt = it.first; jt != it.second; jt++) {
if (offset == 0) {
cpts[i] = jt->second;
} else {
cpts.emplace(cpts.begin() + i + offset, jt->second);
}
offset++;
}
const auto & inner_result = canonical_decomposition_cpts(cpts, i);