Skip to content

Commit aa21a5b

Browse files
authored
jinja : correct default size for string slices (ggml-org#19913)
1 parent 816bdef commit aa21a5b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

common/jinja/runtime.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ value member_expression::execute_impl(context & ctx) {
721721
int64_t arr_size = 0;
722722
if (is_val<value_array>(object)) {
723723
arr_size = object->as_array().size();
724+
} else if (is_val<value_string>(object)) {
725+
arr_size = object->as_string().length();
724726
}
725727

726728
if (is_stmt<slice_expression>(this->property)) {

0 commit comments

Comments
 (0)