Compare commits

..

3 Commits

Author SHA1 Message Date
Amos Wong 1fd6dfe9f3 ui : fix ui clipping in mobile due to incorrect height setup (#24605) 2026-06-14 16:15:51 +02:00
Sigbjørn Skjæret acd79d603c jinja : add count/d/e filter aliases (#24606) 2026-06-14 15:07:31 +02:00
Michael Wand 6e14286eda cli : fix not copying preserved tokens (#24258) 2026-06-14 11:52:15 +02:00
5 changed files with 30 additions and 15 deletions
+14 -6
View File
@@ -316,12 +316,22 @@ value filter_expression::execute_impl(context & ctx) {
JJ_DEBUG("Applying filter to %s", input->type().c_str());
auto set_filter_alias = [](auto & filter_id) {
if (filter_id == "count") {
filter_id = "length";
} else if (filter_id == "d") {
filter_id = "default";
} else if (filter_id == "e") {
filter_id = "escape";
} else if (filter_id == "trim") {
filter_id = "strip";
}
};
if (is_stmt<identifier>(filter)) {
auto filter_id = cast_stmt<identifier>(filter)->val;
if (filter_id == "trim") {
filter_id = "strip"; // alias
}
set_filter_alias(filter_id);
JJ_DEBUG("Applying filter '%s' to %s", filter_id.c_str(), input->type().c_str());
// TODO: Refactor filters so this coercion can be done automatically
if (!input->is_undefined() && !is_val<value_string>(input) && (
@@ -345,9 +355,7 @@ value filter_expression::execute_impl(context & ctx) {
}
auto filter_id = cast_stmt<identifier>(call->callee)->val;
if (filter_id == "trim") {
filter_id = "strip"; // alias
}
set_filter_alias(filter_id);
JJ_DEBUG("Applying filter '%s' with arguments to %s", filter_id.c_str(), input->type().c_str());
func_args args(ctx);
for (const auto & arg_expr : call->args) {
+4 -4
View File
@@ -601,8 +601,8 @@ static void test_filters(testing & t) {
"hello jinja"
);
test_template(t, "length list",
"{{ items|length }}",
test_template(t, "length (count alias) list",
"{{ items|count }}",
{{"items", json::array({1, 2, 3})}},
"3"
);
@@ -711,8 +711,8 @@ static void test_filters(testing & t) {
"fallback"
);
test_template(t, "default with falsy value",
"{{ ''|default('fallback', true) }}",
test_template(t, "default (d alias) with falsy value",
"{{ ''|d('fallback', true) }}",
json::object(),
"fallback"
);
+10 -3
View File
@@ -97,11 +97,18 @@ struct cli_context {
task.params.chat_parser_params.parser.load(chat_params.parser);
}
// Copy the preserved tokens into the sampling params
const llama_vocab * vocab = llama_model_get_vocab(
llama_get_model(ctx_server.get_llama_context()));
for (const auto & token : chat_params.preserved_tokens) {
auto ids = common_tokenize(vocab, token, false, true);
if (ids.size() == 1) {
task.params.sampling.preserved_tokens.insert(ids[0]);
}
}
// reasoning budget sampler
if (!chat_params.thinking_end_tag.empty()) {
const llama_vocab * vocab = llama_model_get_vocab(
llama_get_model(ctx_server.get_llama_context()));
task.params.sampling.reasoning_budget_tokens = defaults.sampling.reasoning_budget_tokens;
task.params.sampling.generation_prompt = chat_params.generation_prompt;
@@ -41,7 +41,7 @@
data-slot="sidebar-wrapper"
style="--sidebar-width: {sidebar.sidebarWidth}; --sidebar-min-width: {SIDEBAR_MIN_WIDTH}; --sidebar-max-width: {SIDEBAR_MAX_WIDTH}; --sidebar-width-icon: {SIDEBAR_WIDTH_ICON}; {style}"
class={cn(
'group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',
'group/sidebar-wrapper flex flex-col min-h-svh w-full has-data-[variant=inset]:bg-sidebar',
className
)}
bind:this={ref}
+1 -1
View File
@@ -312,7 +312,7 @@
/>
<Sidebar.Provider bind:open={sidebarOpen}>
<div class="flex h-screen w-full">
<div class="flex h-full w-full grow">
<Sidebar.Root variant="floating" class="h-full"
><SidebarNavigation bind:this={chatSidebar} /></Sidebar.Root
>