helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: feat: support short flags for permissions

This commit adds short CLI flags for following permission flags:
- "-R" for "--allow-read"
- "-W" for "--allow-write"
- "-E" for "--allow-env"
- "-N" for "--allow-net"
- "-S" for "--allow-sys"

Changed files:
filename: cli/args/flags.rs
patch: @@ -3137,6 +3137,7 @@ fn permission_args(app: Command) -> Command {
     .arg(
       Arg::new("allow-read")
         .long("allow-read")
+        .short('R')
         .num_args(0..)
         .use_value_delimiter(true)
         .require_equals(true)
@@ -3159,6 +3160,7 @@ fn permission_args(app: Command) -> Command {
     .arg(
       Arg::new("allow-write")
         .long("allow-write")
+        .short('W')
         .num_args(0..)
         .use_value_delimiter(true)
         .require_equals(true)
@@ -3181,6 +3183,7 @@ fn permission_args(app: Command) -> Command {
     .arg(
       Arg::new("allow-net")
         .long("allow-net")
+        .short('N')
         .num_args(0..)
         .use_value_delimiter(true)
         .require_equals(true)
@@ -3202,6 +3205,7 @@ fn permission_args(app: Command) -> Command {
     .arg(
       Arg::new("allow-env")
         .long("allow-env")
+        .short('E')
         .num_args(0..)
         .use_value_delimiter(true)
         .require_equals(true)
@@ -3242,6 +3246,7 @@ fn permission_args(app: Command) -> Command {
     .arg(
       Arg::new("allow-sys")
         .long("allow-sys")
+        .short('S')
         .num_args(0..)
         .use_value_delimiter(true)
         .require_equals(true)
@@ -5696,6 +5701,26 @@ mod tests {
     );
   }
 
+  #[test]
+  fn short_permission_flags() {
+    let r = flags_from_vec(svec!["deno", "run", "-RW", "gist.ts"]);
+    assert_eq!(
+      r.unwrap(),
+      Flags {
+        subcommand: DenoSubcommand::Run(RunFlags::new_default(
+          "gist.ts".to_string()
+        )),
+        permissions: PermissionFlags {
+          allow_read: Some(vec![]),
+          allow_write: Some(vec![]),
+          ..Default::default()
+        },
+        code_cache_enabled: true,
+        ..Flags::default()
+      }
+    );
+  }
+
   #[test]
   fn deny_read() {
     let r = flags_from_vec(svec!["deno", "run", "--deny-read", "gist.ts"]);
Repository: nodejs/node
Pull request: doc: update blog link to /vulnerability

cc: @nodejs/security-wg 

Changed files:
filename: SECURITY.md
patch: @@ -218,7 +218,7 @@ as any other stable feature.
 Security notifications will be distributed via the following methods.
 
 * <https://groups.google.com/group/nodejs-sec>
-* <https://nodejs.org/en/blog/>
+* <https://nodejs.org/en/blog/vulnerability>
 
 ## Comments on this policy
Repository: huggingface/transformers
Pull request: Fix pixel attention mask padding in smolvlm

# What does this PR do?

The attention mask (binary) is initialized with zeros in float64, while in make_pixel_mask, the ones and zeros are in int64.

```python
def make_pixel_mask(
    image: np.ndarray, output_size: Tuple[int, int], input_data_format: Optional[Union[str, ChannelDimension]] = None
) -> np.ndarray:
    """
    Make a pixel mask for the image, where 1 indicates a valid pixel and 0 indicates padding.
    Args:
        image (`np.ndarray`):
            Image to make the pixel mask for.
        output_size (`Tuple[int, int]`):
            Output size of the mask.
    """
    input_height, input_width = get_image_size(image, channel_dim=input_data_format)
    mask = np.zeros(output_size, dtype=np.int64)
    mask[:input_height, :input_width] = 1
    return mask
```


Fixes # (issue)

This causes either int64, or float64 mask values depending on if inputs are padded.
This makes MPS devices bug since they don't support float64.

By the way @andimarafioti , we could just cast as np.bool if masks are binary but I guess there is a reason it was done in np.int64 ?

## Who can review?

@orrzohar @andimarafioti @zucchini-nlp


Changed files:
filename: src/transformers/models/idefics3/image_processing_idefics3.py
patch: @@ -581,7 +581,7 @@ def empty_image(size, input_data_format):
         padded_images_list = [
             [empty_image(pad_size, data_format) for _ in range(max_num_images)] for _ in range(batch_size)
         ]
-        padded_masks = [[np.zeros(pad_size) for _ in range(max_num_images)] for _ in range(batch_size)]
+        padded_masks = [[np.zeros(pad_size, dtype=np.int64) for _ in range(max_num_images)] for _ in range(batch_size)]
 
         for batch_idx in range(batch_size):
             for sample_idx, image in enumerate(images[batch_idx]):

filename: src/transformers/models/smolvlm/image_processing_smolvlm.py
patch: @@ -578,7 +578,7 @@ def empty_image(size, input_data_format):
         padded_images_list = [
             [empty_image(pad_size, data_format) for _ in range(max_num_images)] for _ in range(batch_size)
         ]
-        padded_masks = [[np.zeros(pad_size) for _ in range(max_num_images)] for _ in range(batch_size)]
+        padded_masks = [[np.zeros(pad_size, dtype=np.int64) for _ in range(max_num_images)] for _ in range(batch_size)]
 
         for batch_idx in range(batch_size):
             for sample_idx, image in enumerate(images[batch_idx]):
Repository: huggingface/transformers
Pull request: update `test_can_load_with_global_device_set` with a hack

# What does this PR do?

`torch.set_default_device` has some unexpected impacts on other tests even if we try to restore the origin value by calling it at the end of the test. See #37551 for one example that is fixed there.

This PR uses `torch._GLOBAL_DEVICE_CONTEXT` to do something more close to the internal mechanism in `torch.set_default_device` to perform the cleanup, see

https://github.com/pytorch/pytorch/blob/e229ce34c4ab8cd4e2800227615be32fb362b1e6/torch/__init__.py#L1205-L1218



Running 

> RUN_SLOW=1 python3 -m pytest -v tests/models/mask2former/test_modeling_mask2former.py

will pass on this PR while it fails on the base commit (b33edf1b) of this PR.

> FAILED tests/models/mask2former/test_modeling_mask2former.py::Mask2FormerModelTest::test_torch_export - AttributeError: module 'torch._tensor' has no attribute 'split'

>FAILED tests/models/mask2former/test_modeling_mask2former.py::Mask2FormerModelIntegrationTest::test_export - AttributeError: module 'torch._tensor' has no attribute 'split'








Changed files:
filename: tests/test_modeling_common.py
patch: @@ -89,6 +89,7 @@
     require_torch_multi_accelerator,
     require_torch_multi_gpu,
     require_torch_sdpa,
+    run_test_using_subprocess,
     set_config_for_less_flaky_test,
     set_model_for_less_flaky_test,
     set_model_tester_for_less_flaky_test,
@@ -4550,6 +4551,9 @@ def test_can_load_with_device_context_manager(self):
                 unique_devices, {device}, f"All parameters should be on {device}, but found {unique_devices}."
             )
 
+    # Here we need to run with a subprocess as otherwise setting back the default device to the default value ("cpu")
+    # may bring unwanted consequences on other tests. See PR #37553
+    @run_test_using_subprocess
     @require_torch_accelerator
     def test_can_load_with_global_device_set(self):
         config, _ = self.model_tester.prepare_config_and_inputs_for_common()
Repository: nodejs/node
Pull request: doc: call out import.meta is only supported in ES modules

**Problem**: It is called out that dynamic import is supported in both CJS and ES modules. Nothing is mentioned for leading `import.meta`. This can lead to an incorrect assumption that one can use `import.meta.resolve` to resolve a file path to dynamically import from a CJS module. Using `import.meta` in CJS currently throws an error.

**Solution**: Explicitly call out the environments in which `import.meta` is supported.

Changed files:
filename: doc/api/esm.md
patch: @@ -343,7 +343,7 @@ modules it can be used to load ES modules.
 * {Object}
 
 The `import.meta` meta property is an `Object` that contains the following
-properties.
+properties. It is only supported in ES modules.
 
 ### `import.meta.dirname`
Repository: ggml-org/llama.cpp
Pull request: Support tie embedding for chatglm models

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*

The [GLM 1.5B model](https://huggingface.co/THUDM/glm-edge-1.5b-chat/blob/main/config.json#L26) uses tied embeddings, but the chatglm architecture does not take this into account, resulting in a ‘missing tensor ‘output.weight’’ error.this pr is fixed this issue.

Changed files:
filename: src/llama-model.cpp
patch: @@ -3510,7 +3510,11 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
 
                     // output
                     output_norm   = create_tensor(tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd}, 0);
-                    output        = create_tensor(tn(LLM_TENSOR_OUTPUT,      "weight"), {n_embd, n_vocab}, 0);
+                    output        = create_tensor(tn(LLM_TENSOR_OUTPUT,      "weight"), {n_embd, n_vocab}, TENSOR_NOT_REQUIRED);
+                    // if output is NULL, init from the input tok embed
+                    if (output == NULL) {
+                        output = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, TENSOR_DUPLICATED);
+                    }
 
                     for (int i = 0; i < n_layer; ++i) {
                         auto & layer = layers[i];
Repository: denoland/deno
Pull request: fix: cache bust jsr meta file when version not found in dynamic branches

Test and code change in deno_graph.

* https://github.com/denoland/deno_graph/pull/511

Closes https://github.com/denoland/deno/issues/23965

Changed files:
filename: Cargo.lock
patch: @@ -1563,9 +1563,9 @@ dependencies = [
 
 [[package]]
 name = "deno_graph"
-version = "0.81.1"
+version = "0.81.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cada0d9fd56536d3208cff2b130096e396ee2716466850cf0b7927249e40a0"
+checksum = "beccc9d4007be8b85299f696a412f38912fc304cf9519092b47531319ef8a92f"
 dependencies = [
  "anyhow",
  "async-trait",

filename: cli/Cargo.toml
patch: @@ -69,7 +69,7 @@ deno_config = { version = "=0.28.0", features = ["workspace", "sync"] }
 deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
 deno_doc = { version = "0.145.0", features = ["html", "syntect"] }
 deno_emit = "=0.44.0"
-deno_graph = { version = "=0.81.1" }
+deno_graph = { version = "=0.81.2" }
 deno_lint = { version = "=0.62.0", features = ["docs"] }
 deno_lockfile.workspace = true
 deno_npm = "=0.21.4"
Repository: nodejs/node
Pull request: [v22.x backport] build: use glob for dependencies of out/Makefile

Backport of https://github.com/nodejs/node/pull/55789.

---

cc @ruyadorno (FWIW https://github.com/nodejs/node/pull/55789 went out in Node.js 23.3.0 so would usually need to wait another week before landing on LTS to satisfy the 2 weeks in current guide.)

<!--
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: Makefile
patch: @@ -171,8 +171,7 @@ with-code-cache test-code-cache:
 	$(warning '$@' target is a noop)
 
 out/Makefile: config.gypi common.gypi common_node.gypi node.gyp \
-	deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
-	deps/simdutf/simdutf.gyp deps/ada/ada.gyp deps/nbytes/nbytes.gyp \
+	deps/*/*.gyp \
 	tools/v8_gypfiles/toolchain.gypi \
 	tools/v8_gypfiles/features.gypi \
 	tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
Repository: huggingface/transformers
Pull request: Make Ignored Columns ValueError More Informative

# What does this PR do?
Included forward method signature columns in the ValueError so end users will know what columns are expected to be passed to the model in addition to those which are ignored.

## 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?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? [issue 33119](https://github.com/huggingface/transformers/issues/33119#issuecomment-2321681582)
- [ ] 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?

@SunMarc I made the modification discussed previously in the thread linked above.


Changed files:
filename: src/transformers/trainer.py
patch: @@ -939,7 +939,7 @@ def _remove_unused_columns(self, dataset: "datasets.Dataset", description: Optio
         columns = [k for k in signature_columns if k in dataset.column_names]
         if len(columns) == 0:
             raise ValueError(
-                "No columns in the dataset match the model's forward method signature. "
+                "No columns in the dataset match the model's forward method signature: ({', '.join(signature_columns)}). "
                 f"The following columns have been ignored: [{', '.join(ignored_columns)}]. "
                 "Please check the dataset and model. You may need to set `remove_unused_columns=False` in `TrainingArguments`."
             )
Repository: nodejs/node
Pull request: [v22.x backport] module: add `findPackageJSON` util

PR-URL: https://github.com/nodejs/node/pull/55412
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

<!--
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: lib/internal/modules/package_json_reader.js
patch: @@ -7,7 +7,6 @@ const {
   RegExpPrototypeExec,
   StringPrototypeIndexOf,
   StringPrototypeSlice,
-  StringPrototypeStartsWith,
 } = primordials;
 const {
   fileURLToPath,
@@ -285,22 +284,14 @@ function findPackageJSON(specifier, base = 'data:') {
     validateString(specifier, 'specifier');
   }
 
-  let parentURL;
-  if (isURL(base)) {
-    parentURL = new URL(base);
-  } else {
+  let parentURL = base;
+  if (!isURL(base)) {
     validateString(base, 'base');
-    if (
-      path.isAbsolute(base) ||
-      (URLCanParse(base) && !StringPrototypeStartsWith(base, 'file:'))
-    ) {
-      parentURL = pathToFileURL(path.toNamespacedPath(base));
-    } else {
-      parentURL = URL.parse(base) || pathToFileURL(base);
-    }
+    parentURL = path.isAbsolute(base) ? pathToFileURL(base) : new URL(base);
   }
 
   if (specifier && specifier[0] !== '.' && specifier[0] !== '/' && !URLCanParse(specifier)) {
+    // If `specifier` is a bare specifier.
     const { packageJSONPath } = getPackageJSONURL(specifier, parentURL);
     return packageJSONPath;
   }
Repository: ggml-org/llama.cpp
Pull request: llama : deci : support ffn-free with attention

Fix partially overlooked [change request](https://github.com/ggml-org/llama.cpp/pull/12843#discussion_r2068700222), sorry for premature merge.

cc/ @ymcki

Changed files:
filename: src/llama-model.cpp
patch: @@ -4792,7 +4792,7 @@ struct llm_build_deci : public llm_graph_context {
             }
 
             // FFN-free layer of Llama-3_1-Nemotron-Ultra-253B
-            if (n_head == 0 && n_ff == 0) {
+            if (n_ff == 0) {
                 continue;
             }
Repository: denoland/deno
Pull request: fix(node/util): add missing `debug` alias of `debuglog`

Add the missing `node:util.debug` export which is an alias of `node:util.debuglog`, see https://nodejs.org/api/util.html#utildebugsection

Changed files:
filename: ext/node/polyfills/util.ts
patch: @@ -47,6 +47,7 @@ import { parseArgs } from "ext:deno_node/internal/util/parse_args/parse_args.js"
 export {
   callbackify,
   debuglog,
+  debuglog as debug,
   format,
   formatWithOptions,
   inspect,
@@ -321,5 +322,6 @@ export default {
   toUSVString,
   log,
   debuglog,
+  debug: debuglog,
   isDeepStrictEqual,
 };

filename: tests/unit_node/util_test.ts
patch: @@ -8,6 +8,7 @@ import {
 } from "@std/assert";
 import { stripAnsiCode } from "@std/fmt/colors";
 import * as util from "node:util";
+import utilDefault from "node:util";
 import { Buffer } from "node:buffer";
 
 Deno.test({
@@ -322,3 +323,10 @@ Deno.test({
     util.parseArgs({});
   },
 });
+
+Deno.test("[util] debuglog() and debug()", () => {
+  assert(typeof util.debug === "function");
+  assert(typeof util.debuglog === "function");
+  assertEquals(util.debuglog, util.debug);
+  assertEquals(utilDefault.debuglog, utilDefault.debug);
+});
Repository: denoland/deno
Pull request: fix(node/crypto): Assign publicKey and privateKey with let instead of const

Because public/private key are reassigned, they should be `let` instead of `const`.

```ts
  const privateKey = new PrivateKeyObject(privateKeyHandle);  // <- Const here
  const publicKey = new PublicKeyObject(publicKeyHandle); // <- Const here

  if (typeof options === "object" && options !== null) {
    const { publicKeyEncoding, privateKeyEncoding } = options as any;


    if (publicKeyEncoding) {
      publicKey = publicKey.export(publicKeyEncoding); // <- Reassigned here
    }

    if (privateKeyEncoding) {
      privateKey = privateKey.export(privateKeyEncoding);  // <- Reassigned here
    }
  }
```

This gives an error:

`ERROR  Assignment to constant variable.`

Related to
- #23471 

Changed files:
filename: ext/node/polyfills/internal/crypto/keygen.ts
patch: @@ -573,8 +573,8 @@ export function generateKeyPair(
     const privateKeyHandle = op_node_get_private_key_from_pair(pair);
     const publicKeyHandle = op_node_get_public_key_from_pair(pair);
 
-    const privateKey = new PrivateKeyObject(privateKeyHandle);
-    const publicKey = new PublicKeyObject(publicKeyHandle);
+    let privateKey = new PrivateKeyObject(privateKeyHandle);
+    let publicKey = new PublicKeyObject(publicKeyHandle);
 
     if (typeof options === "object" && options !== null) {
       const { publicKeyEncoding, privateKeyEncoding } = options as any;
Repository: nodejs/node
Pull request: tools: remove has_absl_stringify from gyp file

File was removed in https://github.com/nodejs/node/pull/54536



Changed files:
filename: tools/v8_gypfiles/v8.gyp
patch: @@ -2401,7 +2401,6 @@
         '<(ABSEIL_ROOT)/absl/strings/cord_buffer.cc',
         '<(ABSEIL_ROOT)/absl/strings/escaping.h',
         '<(ABSEIL_ROOT)/absl/strings/escaping.cc',
-        '<(ABSEIL_ROOT)/absl/strings/has_absl_stringify.h',
         '<(ABSEIL_ROOT)/absl/strings/has_ostream_operator.h',
         '<(ABSEIL_ROOT)/absl/strings/internal/charconv_bigint.h',
         '<(ABSEIL_ROOT)/absl/strings/internal/charconv_bigint.cc',