helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: os: fix GetInterfaceAddresses memory leaky



- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes
- [x] tests and/or benchmarks are included
- [x] documentation is changed or added
- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)


Changed files:
filename: src/node_os.cc
patch: @@ -214,6 +214,9 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
     return;
   }
 
+  auto cleanup =
+      OnScopeLeave([&]() { uv_free_interface_addresses(interfaces, count); });
+
   Local<Value> no_scope_id = Integer::New(isolate, -1);
   LocalVector<Value> result(isolate);
   result.reserve(count * 7);
@@ -268,7 +271,6 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
     }
   }
 
-  uv_free_interface_addresses(interfaces, count);
   args.GetReturnValue().Set(Array::New(isolate, result.data(), result.size()));
 }
Repository: huggingface/transformers
Pull request: Skip `test_prompt_lookup_decoding_matches_greedy_search` for `voxtral`

# What does this PR do?

> tests/models/voxtral/test_modeling_voxtral.py::VoxtralForConditionalGenerationModelTest::test_prompt_lookup_decoding_matches_greedy_search

is flaky

https://app.circleci.com/pipelines/github/huggingface/transformers/144445/workflows/829f1347-398e-493f-a531-36c3178da153/jobs/1909491

```bash
    @can_return_tuple
    @auto_docstring
    def forward(
        self,
        input_ids: Optional[torch.LongTensor] = None,
        input_features: Optional[torch.FloatTensor] = None,
        attention_mask: Optional[torch.Tensor] = None,
        position_ids: Optional[torch.LongTensor] = None,
        past_key_values: Optional[Cache] = None,
        inputs_embeds: Optional[torch.FloatTensor] = None,
        labels: Optional[torch.LongTensor] = None,
        use_cache: Optional[bool] = None,
        cache_position: Optional[torch.LongTensor] = None,
        logits_to_keep: Union[int, torch.Tensor] = 0,
        **kwargs: Unpack[TransformersKwargs],
    ) -> CausalLMOutputWithPast:
        if inputs_embeds is None:
            inputs_embeds = self.get_input_embeddings()(input_ids)
    
        if input_features is not None:
            audio_embeds = self.get_audio_embeds(input_features)
    
            # replace text-audio token placeholders with audio embeddings
            audio_token_mask = input_ids == self.config.audio_token_id
>           inputs_embeds[audio_token_mask] = audio_embeds
E           RuntimeError: shape mismatch: value tensor of shape [30, 32] cannot be broadcast to indexing result of shape [32, 32]

/usr/local/lib/python3.9/site-packages/transformers/models/voxtral/modeling_voxtral.py:512: RuntimeError```

Changed files:
filename: tests/generation/test_utils.py
patch: @@ -779,6 +779,7 @@ def test_prompt_lookup_decoding_matches_greedy_search(self):
                     "blip2",  # overridden `generate()` for all BLIP models
                     "instructblip",
                     "instructblipvideo",
+                    # TODO: The list is growing huge 🙃! Let's try to check if the config has any of audio/image/video token id and skip the test!
                     # All models below: shouldn't suggest image tokens. Can be fixed by passing `suppress_ids` to candidate generator: @joaa @raushan
                     "llava",
                     "idefics2",
@@ -796,6 +797,8 @@ def test_prompt_lookup_decoding_matches_greedy_search(self):
                     "chameleon",
                     "internvl",
                     "qwen2_5omni",  # the file is named `qwen2_5_omni`, but the model class is `Qwen2_5Omni`,
+                    # All models below: shouldn't suggest audio tokens. Can be fixed by passing `suppress_ids` to candidate generator: @joaa @raushan
+                    "voxtral",
                 ]
             ):
                 self.skipTest(reason="May fix in the future: need model-specific fixes")
Repository: nodejs/node
Pull request: doc: fix `fetch` subsections in `globals.md`

I'm pretty sure those were meant as subsections for `fetch`

| Before | After
| - | - |
| ![Before](https://github.com/user-attachments/assets/4a3a557d-15f7-43e6-b4f3-561d74a28937) | ![After](https://github.com/user-attachments/assets/91f37478-2f7b-4498-8dd2-9e8e9fbe6ead) |



<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/globals.md
patch: @@ -579,7 +579,7 @@ The implementation is based upon [undici](https://undici.nodejs.org), an HTTP/1.
 written from scratch for Node.js. You can figure out which version of `undici` is bundled
 in your Node.js process reading the `process.versions.undici` property.
 
-## Custom dispatcher
+### Custom dispatcher
 
 You can use a custom dispatcher to dispatch requests passing it in fetch's options object.
 The dispatcher must be compatible with `undici`'s
@@ -598,7 +598,7 @@ import { setGlobalDispatcher } from 'undici';
 setGlobalDispatcher(new MyAgent());
 ```
 
-## Related classes
+### Related classes
 
 The following globals are available to use with `fetch`:
Repository: ollama/ollama
Pull request: fix: disable ':' in tag names

Resolves #1247

Changed files:
filename: server/routes.go
patch: @@ -416,6 +416,11 @@ func CreateModelHandler(c *gin.Context) {
 		return
 	}
 
+	if strings.Count(req.Name, ":") > 1 {
+		c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "':' (colon) is not allowed in tag names"})
+		return
+	}
+
 	if req.Path == "" && req.Modelfile == "" {
 		c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "path or modelfile are required"})
 		return
Repository: ggml-org/llama.cpp
Pull request: metal : cap threadgroups size of set_rows

Cap the number of threads in the threadgroup to the limit for the set_rows pipeline. Needed for MTL_DEBUG_LAYER builds.

Changed files:
filename: ggml/src/ggml-metal/ggml-metal-ops.cpp
patch: @@ -1036,6 +1036,11 @@ int ggml_metal_op_set_rows(ggml_metal_op_t ctx, int idx) {
 
     nth = std::min(nth, nk0);
 
+    if (nth*nrptg > ggml_metal_pipeline_max_theads_per_threadgroup(pipeline)) {
+        nth = ggml_metal_pipeline_max_theads_per_threadgroup(pipeline);
+        nrptg = 1;
+    }
+
     ggml_metal_kargs_set_rows args = {
         /*.nk0  =*/ nk0,
         /*.ne01 =*/ ne01,
Repository: denoland/deno
Pull request: fix(ext/node): implement performance.timerify()



fixed(node:perf_hooks): Implement performance.timerify()

Adds the missing implementation for `performance.timerify()` in `node:perf_hooks`, which previously resulted in a "Not implemented" error.

This patch ensures compatibility with Node.js environments by allowing functions to be correctly wrapped.

Fixes #31115 


Changed files:
filename: ext/node/polyfills/perf_hooks.js
patch: @@ -3,7 +3,6 @@
 // TODO(petamoriken): enable prefer-primordials for node polyfills
 // deno-lint-ignore-file prefer-primordials
 
-import { notImplemented } from "ext:deno_node/_utils.ts";
 import { performance, PerformanceEntry } from "ext:deno_web/15_performance.js";
 import { EldHistogram } from "ext:core/ops";
 
@@ -24,12 +23,29 @@ performance.eventLoopUtilization = () => {
   return { idle: 0, active: 0, utilization: 0 };
 };
 
-// TODO(bartlomieju):
 performance.nodeTiming = {};
 
-// TODO(bartlomieju):
-performance.timerify = () => notImplemented("timerify from performance");
+performance.timerify = (fn) => {
+  if (typeof fn !== "function") {
+    throw new TypeError("The 'fn' argument must be of type function");
+  }
+  const wrapped = (...args) => {
+    const start = performance.now();
+    const result = fn(...args);
+    const end = performance.now();
+
+    performance.measure(`timerify(${fn.name || "anonymous"})`, { start, end });
 
+    return result;
+  };
+
+  Object.defineProperty(wrapped, "name", {
+    value: fn.name || "wrapped",
+    configurable: true,
+  });
+
+  return wrapped;
+};
 // TODO(bartlomieju):
 performance.markResourceTiming = () => {};
 

filename: tests/unit_node/timers_test.ts
patch: @@ -4,6 +4,20 @@ import { assert, assertRejects, fail } from "@std/assert";
 import * as timers from "node:timers";
 import * as timersPromises from "node:timers/promises";
 import { assertEquals } from "@std/assert";
+import { performance } from "node:perf_hooks";
+
+Deno.test("[node/perf_hooks] performance.timerify()", () => {
+  function sayHello() {
+    return "hello world";
+  }
+
+  const wrapped = performance.timerify(sayHello);
+  const result = wrapped();
+
+  if (result !== "hello world") {
+    throw new Error(`Expected "hello world", got "${result}"`);
+  }
+});
 
 Deno.test("[node/timers setTimeout]", () => {
   {
Repository: ollama/ollama
Pull request: Correct MacOS Host Port in FAQ

For some reason, the port for MacOS in this how-to was different then the one mentioned before and the one used after in the linux example. Skimming over this and copy pasting this as a Mac user, would result in the ollama program running on a different port and making it unreachable unless the port is changed in all other settings of all things using ollama.

If this was meant to show that you can use other ports, and wasnt just a typo, this would be a very bad way to do it. One single digit being different is nothing a normal person catches and then understands as "You can do this as well"

Changed files:
filename: docs/faq.md
patch: @@ -23,7 +23,7 @@ Ollama binds to 127.0.0.1 port 11434 by default. Change the bind address with th
 On macOS:
 
 ```bash
-OLLAMA_HOST=0.0.0.0:11435 ollama serve
+OLLAMA_HOST=0.0.0.0:11434 ollama serve
 ```
 
 On Linux:
Repository: huggingface/transformers
Pull request: Fix: PIL image load in Processing utils apply_chat_template

# What does this PR do?

This PR #36682 introduced the batch size for images, everything is working correctly but the check for image existence don't support the PPIL images. The `len()` function could work with path or other things. So I converted it to check `is not None` it works for both PIL images and paths or URLs

Note: I made the same fix for videos also 

Fixes #40603 

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@zucchini-nlp 

Changed files:
filename: src/transformers/processing_utils.py
patch: @@ -1637,8 +1637,8 @@ def apply_chat_template(
             ):
                 kwargs["do_sample_frames"] = True
 
-            images_exist = any(len(im) > 0 for im_list in batch_images for im in im_list)
-            videos_exist = any(len(vid) > 0 for vid_list in batch_videos for vid in vid_list)
+            images_exist = any((im is not None) for im_list in batch_images for im in im_list)
+            videos_exist = any((vid is not None) for vid_list in batch_videos for vid in vid_list)
             out = self(
                 text=prompt,
                 images=batch_images if images_exist else None,
Repository: denoland/deno
Pull request: fix: update JSDoc for Deno.cwd() API

This was missed in https://github.com/denoland/deno/pull/27192.

Changed files:
filename: cli/tsc/dts/lib.deno.ns.d.ts
patch: @@ -1700,9 +1700,6 @@ declare namespace Deno {
    *
    * Throws {@linkcode Deno.errors.NotFound} if directory not available.
    *
-   * Requires `allow-read` permission.
-   *
-   * @tags allow-read
    * @category Runtime
    */
   export function cwd(): string;
Repository: facebook/react
Pull request: fix[react-devtools]: add backwards compat with legacy element type symbol

Follow-up to https://github.com/facebook/react/pull/28813.

RDT is using `typeOf` from `react-is` to determine the element display name, I've forked an implementation of this method, but will be using legacy element symbol.

Changed files:
filename: packages/react-devtools-shared/src/utils.js
patch: @@ -23,9 +23,23 @@ import {
   Suspense,
 } from 'react-is';
 import {
+  REACT_CONSUMER_TYPE,
+  REACT_CONTEXT_TYPE,
+  REACT_FORWARD_REF_TYPE,
+  REACT_FRAGMENT_TYPE,
+  REACT_LAZY_TYPE,
+  REACT_LEGACY_ELEMENT_TYPE,
+  REACT_MEMO_TYPE,
+  REACT_PORTAL_TYPE,
+  REACT_PROFILER_TYPE,
+  REACT_PROVIDER_TYPE,
+  REACT_STRICT_MODE_TYPE,
+  REACT_SUSPENSE_LIST_TYPE,
   REACT_SUSPENSE_LIST_TYPE as SuspenseList,
+  REACT_SUSPENSE_TYPE,
   REACT_TRACING_MARKER_TYPE as TracingMarker,
 } from 'shared/ReactSymbols';
+import {enableRenderableContext} from 'shared/ReactFeatureFlags';
 import {
   TREE_OPERATION_ADD,
   TREE_OPERATION_REMOVE,
@@ -695,10 +709,57 @@ export function getDataType(data: Object): DataType {
   }
 }
 
+// Fork of packages/react-is/src/ReactIs.js:30, but with legacy element type
+// Which has been changed in https://github.com/facebook/react/pull/28813
+function typeOfWithLegacyElementSymbol(object: any): mixed {
+  if (typeof object === 'object' && object !== null) {
+    const $$typeof = object.$$typeof;
+    switch ($$typeof) {
+      case REACT_LEGACY_ELEMENT_TYPE:
+        const type = object.type;
+
+        switch (type) {
+          case REACT_FRAGMENT_TYPE:
+          case REACT_PROFILER_TYPE:
+          case REACT_STRICT_MODE_TYPE:
+          case REACT_SUSPENSE_TYPE:
+          case REACT_SUSPENSE_LIST_TYPE:
+            return type;
+          default:
+            const $$typeofType = type && type.$$typeof;
+
+            switch ($$typeofType) {
+              case REACT_CONTEXT_TYPE:
+              case REACT_FORWARD_REF_TYPE:
+              case REACT_LAZY_TYPE:
+              case REACT_MEMO_TYPE:
+                return $$typeofType;
+              case REACT_CONSUMER_TYPE:
+                if (enableRenderableContext) {
+                  return $$typeofType;
+                }
+              // Fall through
+              case REACT_PROVIDER_TYPE:
+                if (!enableRenderableContext) {
+                  return $$typeofType;
+                }
+              // Fall through
+              default:
+                return $$typeof;
+            }
+        }
+      case REACT_PORTAL_TYPE:
+        return $$typeof;
+    }
+  }
+
+  return undefined;
+}
+
 export function getDisplayNameForReactElement(
   element: React$Element<any>,
 ): string | null {
-  const elementType = typeOf(element);
+  const elementType = typeOf(element) || typeOfWithLegacyElementSymbol(element);
   switch (elementType) {
     case ContextConsumer:
       return 'ContextConsumer';
Repository: vercel/next.js
Pull request: Turbopack: use bail in track_glob_internal

Eventual consistency strikes again (?)

Closes PACK-5392

Changed files:
filename: turbopack/crates/turbo-tasks-fs/src/read_glob.rs
patch: @@ -197,11 +197,12 @@ async fn track_glob_internal(
                             reads.push(fs.read(path.clone()))
                         }
                     }
-                    DirectoryEntry::Symlink(symlink_path) => unreachable!(
+                    DirectoryEntry::Symlink(symlink_path) => bail!(
                         "resolve_symlink_safely() should have resolved all symlinks, but found \
                          unresolved symlink at path: '{}'. Found path: '{}'. Please report this \
                          as a bug.",
-                        entry_path, symlink_path
+                        entry_path,
+                        symlink_path
                     ),
                     DirectoryEntry::Other(path) => {
                         if glob_value.matches(&entry_path) {
Repository: ggml-org/llama.cpp
Pull request: memory: Hybrid context shift

Closes #16768 

cc @leok7v

## Description

This PR addresses context shift failure caused when a hybrid-recurrent model hits its context limit and attempts to perform context shifting. The main change here is to loosen the restriction in the `llama_memory_recurrent::seq_rm` to only refuse to do a partial erasure if the part being erased includes the final token in the sequence. Since recurrent states are fixed size, any partial erasure that does not include the final token can be considered a no-op.

## Testing

To validate the result, you can use the following which artificially limits the context length to force a context shift:

```sh
# You can use any granite-4.0 model here
./bin/llama-cli -m ggml-org/granite-4.0-h-small-Q8_0-GGUF --jinja -c 100 --context-shift -p "tell me a story"
```

Without this fix, it will fail with `init_batch: failed to prepare attention ubatches`, but with this fix, it will successfully continue generating _and_ produce generated output that is relevant to the previous context.

Changed files:
filename: src/llama-memory-recurrent.cpp
patch: @@ -151,7 +151,8 @@ bool llama_memory_recurrent::seq_rm(llama_seq_id seq_id, llama_pos p0, llama_pos
         p1 = std::numeric_limits<llama_pos>::max();
     }
 
-    // models like Mamba or RWKV can't have a state partially erased
+    // models like Mamba or RWKV can't have a state partially erased at the end
+    // of the sequence because their state isn't preserved for previous tokens
     if (seq_id >= (int64_t) size) {
         // could be fatal
         return false;
@@ -160,8 +161,8 @@ bool llama_memory_recurrent::seq_rm(llama_seq_id seq_id, llama_pos p0, llama_pos
         int32_t & tail_id = cells[seq_id].tail;
         if (tail_id >= 0) {
             const auto & cell = cells[tail_id];
-            // partial intersection is invalid
-            if ((0 < p0 && p0 < cell.pos) || (0 < p1 && p1 <= cell.pos)) {
+            // partial intersection is invalid if it includes the final pos
+            if (0 < p0 && p0 <= cell.pos && p1 > cell.pos) {
                 //printf("[DEBUG] inside `llama_memory_recurrent::seq_rm`: partial intersection is invalid, so returning false\n");
                 return false;
             }

filename: tools/main/main.cpp
patch: @@ -354,7 +354,11 @@ int main(int argc, char ** argv) {
         }
 
         // remove any "future" tokens that we might have inherited from the previous session
-        llama_memory_seq_rm(mem, -1, n_matching_session_tokens, -1);
+        if (!llama_memory_seq_rm(mem, -1, n_matching_session_tokens, -1)) {
+            LOG_INF("%s: unable to resuse common prefix\n", __func__);
+            n_matching_session_tokens = 0;
+            llama_memory_seq_rm(mem, -1, -1, -1);
+        }
     }
 
     LOG_DBG("recalculate the cached logits (check): embd_inp.size() %zu, n_matching_session_tokens %zu, embd_inp.size() %zu, session_tokens.size() %zu\n",
Repository: ggml-org/llama.cpp
Pull request: vulkan: fix validation issue introduced by #16868


Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -6831,7 +6831,7 @@ static void ggml_vk_mul_mat_vec_q_f16(ggml_backend_vk_context * ctx, vk_context&
 
     vk_buffer d_B = d_D;
     size_t b_buf_offset = 0;
-    uint64_t b_sz = 0;
+    uint64_t b_sz = 1;
 
     if (enable_bias) {
         const ggml_tensor * add = cgraph->nodes[node_idx + 1];
@@ -6965,7 +6965,7 @@ static void ggml_vk_mul_mat_vec_p021_f16_f32(ggml_backend_vk_context * ctx, vk_c
 
     vk_buffer d_B = d_D;
     size_t b_buf_offset = 0;
-    uint64_t b_sz = 0;
+    uint64_t b_sz = 1;
 
     if (enable_bias) {
         const ggml_tensor * add = cgraph->nodes[node_idx + 1];
@@ -7101,7 +7101,7 @@ static void ggml_vk_mul_mat_vec_nc_f16_f32(ggml_backend_vk_context * ctx, vk_con
 
     vk_buffer d_B = d_D;
     size_t b_buf_offset = 0;
-    uint64_t b_sz = 0;
+    uint64_t b_sz = 1;
 
     if (enable_bias) {
         const ggml_tensor * add = cgraph->nodes[node_idx + 1];
@@ -7676,7 +7676,7 @@ static void ggml_vk_mul_mat_vec_id_q_f16(ggml_backend_vk_context * ctx, vk_conte
 
     vk_buffer d_B = d_D;
     size_t b_buf_offset = 0;
-    uint64_t b_sz = 0;
+    uint64_t b_sz = 1;
 
     if (enable_bias || enable_scale) {
         const ggml_tensor * bias = cgraph->nodes[node_idx + 1]->src[1];
Repository: huggingface/transformers
Pull request: [auto-model] propagate kwargs

# What does this PR do?

Fixes [40477](https://github.com/huggingface/transformers/issues/40477) and propagates kwargs in deprecated auto models


Changed files:
filename: src/transformers/models/auto/modeling_auto.py
patch: @@ -2207,14 +2207,14 @@ class AutoModelForAudioTokenization(_BaseAutoModelClass):
 
 class AutoModelWithLMHead(_AutoModelWithLMHead):
     @classmethod
-    def from_config(cls, config):
+    def from_config(cls, config, **kwargs):
         warnings.warn(
             "The class `AutoModelWithLMHead` is deprecated and will be removed in a future version. Please use "
             "`AutoModelForCausalLM` for causal language models, `AutoModelForMaskedLM` for masked language models and "
             "`AutoModelForSeq2SeqLM` for encoder-decoder models.",
             FutureWarning,
         )
-        return super().from_config(config)
+        return super().from_config(config, **kwargs)
 
     @classmethod
     def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
@@ -2229,13 +2229,13 @@ def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
 
 class AutoModelForVision2Seq(_AutoModelForVision2Seq):
     @classmethod
-    def from_config(cls, config):
+    def from_config(cls, config, **kwargs):
         warnings.warn(
             "The class `AutoModelForVision2Seq` is deprecated and will be removed in v5.0. Please use "
             "`AutoModelForImageTextToText` instead.",
             FutureWarning,
         )
-        return super().from_config(config)
+        return super().from_config(config, **kwargs)
 
     @classmethod
     def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):