helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: [`PEFT`] Fix prefix tuning

Prefix tuning is a bit more of a special case where we have different q and kv lengths despite having the encoder attention. We now rely on the mask for kv length now (if provided). The assumption was holding before because causal masks always have q == kv length. Fixes https://github.com/huggingface/transformers/pull/38301#issuecomment-3415672560

cc @BenjaminBossan 

Changed files:
filename: src/transformers/masking_utils.py
patch: @@ -733,9 +733,19 @@ def _preprocess_mask_arguments(
     # If using a cache, it can give all information about mask sizes based on seen tokens
     if past_key_values is not None:
         kv_length, kv_offset = past_key_values.get_mask_sizes(cache_position, layer_idx)
-    # Otherwise, the sizes are simply the input sizes
+    # Otherwise, we infer based on our input
     else:
-        kv_length, kv_offset = input_embeds.shape[1], 0
+        # 1. Rely on input directly
+        if attention_mask is None:
+            kv_length, kv_offset = input_embeds.shape[1], 0
+        # 2. Rely on the mask instead - needed for special cases like prefix tuning in PEFT
+        #
+        # This is a very unique and special case where an encoder utilizes a cache and expects its length
+        # to be accounted for (usually, they should never use a cache). In general, the mask should always
+        # match with the input sizes nonetheless (i.e. it does not affect others).
+        # Conclusion: "prefix tuning is evil"
+        else:
+            kv_length, kv_offset = attention_mask.shape[-1], 0
 
     # We check the position_ids for potential packed sequence format (only if the 2D attention mask is explicitly None,
     # and we don't have past_key_values, i.e. generally a training setup)
Repository: nodejs/node
Pull request: doc: `createSQLTagStore` -> `createTagStore`

cc @0hmx to confirm that this is correct.

#58748 added a new method, `createTagStore`, but it's improperly documented as `createSQLTagStore`

Ref: https://discord.com/channels/425824580918181889/425824580918181891/1425966053242048584

Changed files:
filename: doc/api/sqlite.md
patch: @@ -436,7 +436,7 @@ added: v22.5.0
 Compiles a SQL statement into a [prepared statement][]. This method is a wrapper
 around [`sqlite3_prepare_v2()`][].
 
-### `database.createSQLTagStore([maxSize])`
+### `database.createTagStore([maxSize])`
 
 <!-- YAML
 added: v24.9.0
@@ -460,7 +460,7 @@ avoid the overhead of repeatedly parsing and preparing the same SQL statements.
 import { DatabaseSync } from 'node:sqlite';
 
 const db = new DatabaseSync(':memory:');
-const sql = db.createSQLTagStore();
+const sql = db.createTagStore();
 
 db.exec('CREATE TABLE users (id INT, name TEXT)');
 
@@ -635,14 +635,14 @@ added: v24.9.0
 This class represents a single LRU (Least Recently Used) cache for storing
 prepared statements.
 
-Instances of this class are created via the database.createSQLTagStore() method,
+Instances of this class are created via the database.createTagStore() method,
 not by using a constructor. The store caches prepared statements based on the
 provided SQL query string. When the same query is seen again, the store
 retrieves the cached statement and safely applies the new values through
 parameter binding, thereby preventing attacks like SQL injection.
 
 The cache has a maxSize that defaults to 1000 statements, but a custom size can
-be provided (e.g., database.createSQLTagStore(100)). All APIs exposed by this
+be provided (e.g., database.createTagStore(100)). All APIs exposed by this
 class execute synchronously.
 
 ### `sqlTagStore.all(sqlTemplate[, ...values])`
Repository: facebook/react
Pull request: [crud] Fix copy paste typo


Happens to the best of us.


Changed files:
filename: packages/react-reconciler/src/ReactFiberHooks.js
patch: @@ -5241,8 +5241,8 @@ if (__DEV__) {
         return mountEvent(callback);
       };
   }
-  if (InvalidNestedHooksDispatcherOnMountInDEV) {
-    (HooksDispatcherOnRerenderInDEV: Dispatcher).useResourceEffect =
+  if (enableUseResourceEffectHook) {
+    (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useResourceEffect =
       function useResourceEffect(
         create: () => mixed,
         createDeps: Array<mixed> | void | null,
Repository: ollama/ollama
Pull request: llm: remove ambiguous log message when placing an upper limit on predictions


Changed files:
filename: llm/server.go
patch: @@ -699,10 +699,9 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu
 	}
 	defer s.sem.Release(1)
 
-	// only allow maximum 10 "context shifts" to avoid infinite generation
+	// put an upper limit on num_predict to avoid the model running on forever
 	if req.Options.NumPredict < 0 || req.Options.NumPredict > 10*s.options.NumCtx {
 		req.Options.NumPredict = 10 * s.options.NumCtx
-		slog.Debug("setting token limit to 10x num_ctx", "num_ctx", s.options.NumCtx, "num_predict", req.Options.NumPredict)
 	}
 
 	request := map[string]any{
Repository: ggml-org/llama.cpp
Pull request: model-loader : support bool array sliding window pattern

Several models have been storing sliding window pattern metadata as bool arrays. Attempting to load this metadata will crash because (a) BOOL arrays are unsupported (b) the arrays are copied directly.

Luckily none of the models in questions have actually used this data yet, nevertheless this PR implements support by transforming the bools to avoid confusion, like here https://github.com/ggml-org/llama.cpp/pull/18719#discussion_r2690691130

* Gemma3 https://github.com/ggml-org/llama.cpp/blob/599af063fad56928cca26bb2fff06dfa25b852a3/convert_hf_to_gguf.py#L6302-L6305
* Olmo3 https://github.com/ggml-org/llama.cpp/blob/599af063fad56928cca26bb2fff06dfa25b852a3/convert_hf_to_gguf.py#L7051-L7060
* Exaone4 https://github.com/ggml-org/llama.cpp/blob/599af063fad56928cca26bb2fff06dfa25b852a3/convert_hf_to_gguf.py#L8711-L8712

Changed files:
filename: src/llama-model-loader.cpp
patch: @@ -2,6 +2,7 @@
 
 #include "ggml.h"
 
+#include <algorithm>
 #include <array>
 #include <cinttypes>
 #include <cstring>
@@ -344,6 +345,7 @@ namespace GGUFMeta {
             GGUFMeta::GKV<GGUFMeta::ArrayInfo>::get_kv(ctx, kid);
 
         switch (arr_info.gt) {
+            case GGUF_TYPE_BOOL:
             case GGUF_TYPE_UINT32:
             case GGUF_TYPE_INT32:   GGML_ASSERT((std::is_same<T,     int32_t>::value) ||
                                                 (std::is_same<T,    uint32_t>::value)); break;
@@ -365,7 +367,13 @@ namespace GGUFMeta {
                 result[i] = value;
             }
         } else {
-            std::copy((const T*)arr_info.data, (const T *)arr_info.data + arr_info.length, result.begin());
+            if (arr_info.gt == GGUF_TYPE_BOOL) {
+                std::transform((const bool *)arr_info.data, (const bool *)arr_info.data + arr_info.length, result.begin(), [](bool x) {
+                    return static_cast<T>(x);
+                });
+            } else {
+                std::copy((const T*)arr_info.data, (const T *)arr_info.data + arr_info.length, result.begin());
+            }
         }
 
         return true;
Repository: ollama/ollama
Pull request: llm: allow gemma 2 to context shift


Changed files:
filename: llm/ext_server/server.cpp
patch: @@ -1688,22 +1688,8 @@ struct llama_server_context
                     }
                     slot.params.n_keep = std::min(slot.n_ctx - 4, slot.params.n_keep);
 
-                    char buf[256];
-                    llama_model_meta_val_str(model, "general.architecture", buf, 256);
-                    bool gemma2 = strcmp(buf, "gemma2") == 0;
-
-                    int32_t truncate_at = slot.n_ctx;
-
-                    // truncate at 2/3 of the context length for gemma2 models
-                    // as they do not support context shifts (from the sliding window implementation).
-                    // this way, prompts that almost fit the context length can still generate a full
-                    // response without a sudden stop from hitting the context limit
-                    if (gemma2) {
-                        truncate_at = 2 * slot.n_ctx / 3;
-                    }
-
                     // if input prompt is too big, truncate it, if group attention self-extend is disabled
-                    if (slot.ga_n == 1 && slot.n_prompt_tokens >= truncate_at)
+                    if (slot.ga_n == 1 && slot.n_prompt_tokens >= slot.n_ctx)
                     {
                         const int n_left = slot.n_ctx - slot.params.n_keep;
                         const int n_shift = n_left / 2;
@@ -1731,19 +1717,6 @@ struct llama_server_context
                         GGML_ASSERT(slot.n_prompt_tokens < slot.n_ctx);
                     }
 
-                    // Models with sliding window attention do not work with context shifts, so
-                    // limit their prediction to the context length
-                    if (gemma2) {
-                        int32_t limit = slot.n_ctx - slot.n_prompt_tokens;
-                        slot.n_predict = limit;
-                        slot.params.n_predict = limit;
-                        LOG_INFO("model does not support sliding window, limiting generation", {
-                            {"n_ctx", slot.n_ctx},
-                            {"n_prompt_tokens", slot.n_prompt_tokens},
-                            {"n_predict", slot.n_predict}
-                        });
-                    }
-
                     if (!slot.params.cache_prompt)
                     {
                         llama_sampling_reset(slot.ctx_sampling);
Repository: huggingface/transformers
Pull request: Remove unnecessary slicing in sdpa_attention_forward

The slicing in sdpa_attention_forward was there only because some masks were not constructed correctly (I was told). When the key size is dynamic, the slice op also prevents torch.export from correctly reasoning about its size.

cc @vasqu


Changed files:
filename: src/transformers/integrations/sdpa_attention.py
patch: @@ -63,9 +63,6 @@ def sdpa_attention_forward(
         else:
             sdpa_kwargs = {"enable_gqa": True}
 
-    if attention_mask is not None and attention_mask.ndim == 4:
-        attention_mask = attention_mask[:, :, :, : key.shape[-2]]
-
     # Instead of relying on the value set in the module directly, we use the is_causal passed in kwargs if it is presented
     is_causal = is_causal if is_causal is not None else getattr(module, "is_causal", True)
Repository: vuejs/vue
Pull request: Warn if coerce is not a function

Reference: https://github.com/vuejs/vue/issues/2926


Changed files:
filename: src/compiler/compile-props.js
patch: @@ -236,7 +236,7 @@ function processPropValue (vm, prop, rawValue, fn) {
   if (value === undefined) {
     value = getPropDefaultValue(vm, prop)
   }
-  value = coerceProp(prop, value)
+  value = coerceProp(prop, value, vm)
   const coerced = value !== rawValue
   if (!assertProp(prop, value, vm)) {
     value = undefined
@@ -374,13 +374,20 @@ function assertProp (prop, value, vm) {
  * @return {*}
  */
 
-function coerceProp (prop, value) {
+function coerceProp (prop, value, vm) {
   var coerce = prop.options.coerce
   if (!coerce) {
     return value
   }
-  // coerce is a function
-  return coerce(value)
+  if (typeof coerce === 'function') {
+    return coerce(value)
+  } else {
+    process.env.NODE_ENV !== 'production' && warn(
+      'Invalid coerce for prop "' + prop.name + '": expected function, got ' + typeof coerce + '.',
+      vm
+    )
+    return value
+  }
 }
 
 /**

filename: test/unit/specs/directives/internal/prop_spec.js
patch: @@ -423,6 +423,12 @@ describe('prop', function () {
       expect(getWarnCount()).toBe(0)
     })
 
+    it('warn if coerce is not a function', function () {
+      var coerce = 1
+      makeInstance('123', String, null, coerce)
+      expect(getWarnCount()).toBe(1)
+    })
+
     it('multiple types + custom validator', function () {
       makeInstance(123, [String, Boolean, Number], null, String)
       expect(getWarnCount()).toBe(0)
Repository: ollama/ollama
Pull request: Update llama.cpp submodule to `a8db2a9c`


Changed files:
filename: llm/llama.cpp
patch: @@ -1 +1 @@
-Subproject commit d7fd29fff16456ce9c3a23fd2d09a66256b05aff
+Subproject commit a8db2a9ce64cd4417f6a312ab61858f17f0f8584

filename: llm/patches/05-default-pretokenizer.diff
patch: @@ -1,11 +1,11 @@
 diff --git a/src/llama.cpp b/src/llama.cpp
-index 73f52435..2b81b4bd 100644
+index 2b9ace28..172640e2 100644
 --- a/src/llama.cpp
 +++ b/src/llama.cpp
-@@ -5092,16 +5092,7 @@ static void llm_load_vocab(
- 
-         // for now, only BPE models have pre-tokenizers
+@@ -5357,16 +5357,7 @@ static void llm_load_vocab(
          if (vocab.type == LLAMA_VOCAB_TYPE_BPE) {
+             vocab.tokenizer_add_space_prefix = false;
+             vocab.tokenizer_clean_spaces = true;
 -            if (tokenizer_pre.empty()) {
 -                LLAMA_LOG_WARN("%s: missing pre-tokenizer type, using: 'default'\n", __func__);
 -                LLAMA_LOG_WARN("%s:                                             \n", __func__);
@@ -20,7 +20,7 @@ index 73f52435..2b81b4bd 100644
                  vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
              } else if (
                      tokenizer_pre == "llama3"   ||
-@@ -5164,7 +5155,8 @@ static void llm_load_vocab(
+@@ -5439,7 +5430,8 @@ static void llm_load_vocab(
                  tokenizer_pre == "jais") {
                  vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_JAIS;
              } else {
Repository: ggml-org/llama.cpp
Pull request: Fix mismatch of EXAONE-MoE configuration

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*

- Fix the issue mentioned at https://github.com/ggml-org/llama.cpp/pull/18543

Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -8772,11 +8772,7 @@ def set_gguf_parameters(self):
         self.gguf_writer.add_expert_weights_norm(self.hparams["norm_topk_prob"])
         n_dense_layer = self.hparams.get("first_k_dense_replace", self.hparams.get("first_last_k_dense_replace", 0))
         self.gguf_writer.add_leading_dense_block_count(n_dense_layer)
-        # For here, we hard-code the number of NextN/MTP layers to 1 for K-EXAONE,
-        # so that we can convert MTP weights to GGUF format for speculative decoding.
-        # This is because HF config of K-EXAONE does not have `num_nextn_predict_layers` at now.
-        # Will be updated when HF config is updated.
-        self.gguf_writer.add_nextn_predict_layers(self.hparams.get("num_nextn_predict_layers", 1))
+        self.gguf_writer.add_nextn_predict_layers(self.hparams.get("num_nextn_predict_layers", 0))
 
         self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.NONE)
 

filename: src/llama-model.cpp
patch: @@ -1942,16 +1942,12 @@ void llama_model::load_hparams(llama_model_loader & ml) {
                 hparams.rope_freq_scale_train_swa = hparams.rope_freq_scale_train;
 
                 ml.get_key(LLM_KV_ROPE_FREQ_BASE_SWA,                hparams.rope_freq_base_train_swa, false);
-                ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW,          hparams.n_swa, true);
+                ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW,          hparams.n_swa);
                 ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS,       hparams.f_norm_rms_eps);
-                ml.get_key(LLM_KV_EXPERT_COUNT,                      hparams.n_expert);
-                ml.get_key(LLM_KV_EXPERT_USED_COUNT,                 hparams.n_expert_used);
                 ml.get_key(LLM_KV_EXPERT_SHARED_COUNT,               hparams.n_expert_shared, false);
                 ml.get_key(LLM_KV_EXPERT_FEED_FORWARD_LENGTH,        hparams.n_ff_exp);
                 ml.get_key(LLM_KV_EXPERT_SHARED_FEED_FORWARD_LENGTH, hparams.n_ff_shexp, false);
-                ml.get_key(LLM_KV_EXPERT_GROUP_COUNT,                hparams.n_expert_groups, false);
-                ml.get_key(LLM_KV_EXPERT_GROUP_USED_COUNT,           hparams.n_group_used, false);
-                ml.get_key(LLM_KV_EXPERT_GATING_FUNC,                hparams.expert_gating_func, false);
+                ml.get_key(LLM_KV_EXPERT_GATING_FUNC,                hparams.expert_gating_func);
                 ml.get_key(LLM_KV_EXPERT_WEIGHTS_SCALE,              hparams.expert_weights_scale, false);
                 ml.get_key(LLM_KV_EXPERT_WEIGHTS_NORM,               hparams.expert_weights_norm, false);
                 ml.get_key(LLM_KV_LEADING_DENSE_BLOCK_COUNT,         hparams.n_layer_dense_lead);
Repository: nodejs/node
Pull request: test: mark sea tests flaky on macOS x64

Refs: https://github.com/nodejs/node/issues/59553

---

These tests are occasionally failing in the CI on osx13-x64, but appear to be always failing on macos15-x64 and blocking anything from landing that requires a full CI.

Changed files:
filename: test/sequential/sequential.status
patch: @@ -25,8 +25,27 @@ test-http2-large-file: PASS, FLAKY
 test-http-server-request-timeouts-mixed: PASS, FLAKY
 
 [$system==macos]
-# https://github.com/nodejs/node/issues/54816
+
+[$system==macos && $arch==x64]
+# https://github.com/nodejs/node/issues/59553
+test-single-executable-application: PASS, FLAKY
+test-single-executable-application-assets: PASS, FLAKY
+test-single-executable-application-assets-raw: PASS, FLAKY
+test-single-executable-application-asset-keys-empty: PASS, FLAKY
+test-single-executable-application-asset-keys: PASS, FLAKY
+test-single-executable-application-disable-experimental-sea-warning: PASS, FLAKY
 test-single-executable-application-empty: PASS, FLAKY
+test-single-executable-application-exec-argv: PASS, FLAKY
+test-single-executable-application-exec-argv-empty: PASS, FLAKY
+test-single-executable-application-exec-argv-extension-cli: PASS, FLAKY
+test-single-executable-application-exec-argv-extension-env: PASS, FLAKY
+test-single-executable-application-exec-argv-extension-none: PASS, FLAKY
+test-single-executable-application-inspect-in-sea-flags: PASS, FLAKY
+test-single-executable-application-inspect: PASS, FLAKY
+test-single-executable-application-snapshot: PASS, FLAKY
+test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
+test-single-executable-application-snapshot-worker: PASS, FLAKY
+test-single-executable-application-use-code-cache: PASS, FLAKY
 
 # https://github.com/nodejs/node/issues/43465
 test-http-server-request-timeouts-mixed: PASS, FLAKY
Repository: huggingface/transformers
Pull request: [`Pop2Piano`] Fix cache usage

I don't want to speak about his :see_no_evil: 

Changed files:
filename: src/transformers/models/pop2piano/modeling_pop2piano.py
patch: @@ -750,7 +750,8 @@ def forward(
                 position_bias,
                 encoder_hidden_states,
                 encoder_extended_attention_mask,
-                encoder_decoder_position_bias,  # as a positional argument for gradient checkpointing                past_key_values=past_key_values,
+                encoder_decoder_position_bias,  # as a positional argument for gradient checkpointing
+                past_key_values=past_key_values,
                 use_cache=use_cache,
                 output_attentions=output_attentions,
                 cache_position=cache_position,
Repository: vuejs/vue
Pull request: added ref directive tests


Changed files:
filename: test/unit/features/directives/ref.spec.js
patch: @@ -0,0 +1,72 @@
+import Vue from 'vue'
+
+describe('Directive v-ref', () => {
+  const components = {
+    test: {
+      id: 'test'
+    },
+    test2: {
+      id: 'test2'
+    }
+  }
+
+  it('should accept hyphenated refs', () => {
+    const vm = new Vue({
+      template: `<div>
+        <test v-ref:test></test>
+        <test2 v-ref:test-hyphen></test2>
+      </div>`,
+      components
+    })
+    vm.$mount()
+    expect(vm.$refs.test).toBeTruthy()
+    expect(vm.$refs.test.$options.id).toBe('test')
+    expect(vm.$refs['test-hyphen']).toBeTruthy()
+    expect(vm.$refs['test-hyphen'].$options.id).toBe('test2')
+  })
+
+  it('should accept camelCase refs', () => {
+    const vm = new Vue({
+      template:
+        `<div>
+          <test v-ref:test></test>
+          <test2 v-ref:testCase></test2>
+        </div>`,
+      components
+    })
+    vm.$mount()
+    expect(vm.$refs.test).toBeTruthy()
+    expect(vm.$refs.test.$options.id).toBe('test')
+    expect(vm.$refs.testCase).toBeTruthy()
+    expect(vm.$refs.testCase.$options.id).toBe('test2')
+  })
+
+  it('should accept HOC component', () => {
+    const vm = new Vue({
+      template: '<test v-ref:test></test>',
+      components
+    })
+    vm.$mount()
+    expect(vm.$refs.test).toBeTruthy()
+    expect(vm.$refs.test.$options.id).toBe('test')
+  })
+
+  it('should accept dynamic component', done => {
+    const vm = new Vue({
+      template: `<div>
+        <component :is="test" v-ref:test></component>
+      </div>`,
+      components,
+      data: { test: 'test' }
+    })
+    vm.$mount()
+    expect(vm.$refs.test.$options.id).toBe('test')
+    vm.test = 'test2'
+    waitForUpdate(() => {
+      expect(vm.$refs.test.$options.id).toBe('test2')
+      vm.test = ''
+    }).then(() => {
+      expect(vm.$refs.test).toBeUndefined()
+    }).then(done)
+  })
+})
Repository: ollama/ollama
Pull request: llm: print caching notices in debug only


Changed files:
filename: llm/ext_server/server.cpp
patch: @@ -1413,7 +1413,7 @@ struct llama_server_context
             return get_slot(-1);
         }
 
-        LOG_INFO("slot with common prefix found", {{
+        LOG_DEBUG("slot with common prefix found", {{
             "slot_id", slot->id,
             "characters", longest
         }});
Repository: facebook/react
Pull request: [playground] Fix incorrect ci path and change reporter

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31572).
* #31573
* __->__ #31572

Changed files:
filename: .github/workflows/compiler_playground.yml
patch: @@ -6,7 +6,7 @@ on:
   pull_request:
     paths:
       - compiler/**
-      - .github/workflows/compiler-playground.yml
+      - .github/workflows/compiler_playground.yml
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
@@ -44,10 +44,12 @@ jobs:
       - name: yarn install playground
         run: yarn install --frozen-lockfile
       - run: npx playwright install --with-deps chromium
-      - run: yarn test
+      - run: CI=true yarn test
+      - run: ls -R test-results
+        if: '!cancelled()'
       - name: Archive test results
         if: '!cancelled()'
         uses: actions/upload-artifact@v4
         with:
           name: test-results
-          path: test-results
+          path: compiler/apps/playground/test-results

filename: compiler/apps/playground/playwright.config.js
patch: @@ -36,6 +36,10 @@ export default defineConfig({
     reuseExistingServer: !process.env.CI,
   },
 
+  // 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
+  // default 'list' when running locally
+  reporter: process.env.CI ? 'github' : 'list',
+
   use: {
     // Use baseURL so to make navigations relative.
     // More information: https://playwright.dev/docs/api/class-testoptions#test-options-base-url