helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: Fix incorrect bbox_embed initialization when decoder_bbox_embed_share=False in GroundingDINO

Fixes #37333

This PR corrects the initialization of the bbox_embed layers in GroundingDinoForObjectDetection when config.decoder_bbox_embed_share is set to False.

 What does this PR do?
Previously, the bbox_embed list was not properly initialized with independent layers when decoder_bbox_embed_share=False. The current implementation mistakenly overwrites the list in each loop iteration, resulting in incorrect behavior.

This PR:

Ensures that a new GroundingDinoMLPPredictionHead is created per decoder layer when decoder_bbox_embed_share=False

Uses nn.ModuleList properly to store separate instances

Preserves shared head behavior when decoder_bbox_embed_share=True

 Motivation
Fixing this ensures that each decoder layer has its own bounding box prediction head when specified, which is essential for the expected decoding behavior and model performance.

Changed files:
filename: src/transformers/models/grounding_dino/modeling_grounding_dino.py
patch: @@ -2454,16 +2454,25 @@ def __init__(self, config: GroundingDinoConfig):
         _class_embed = GroundingDinoContrastiveEmbedding(config)
 
         if config.decoder_bbox_embed_share:
-            _bbox_embed = GroundingDinoMLPPredictionHead(
+            # a single shared instance
+            shared_head = GroundingDinoMLPPredictionHead(
                 input_dim=config.d_model, hidden_dim=config.d_model, output_dim=4, num_layers=3
             )
-            self.bbox_embed = nn.ModuleList([_bbox_embed for _ in range(config.decoder_layers)])
+            self.bbox_embed = nn.ModuleList([shared_head] * config.decoder_layers)
         else:
-            for _ in range(config.decoder_layers):
-                _bbox_embed = GroundingDinoMLPPredictionHead(
-                    input_dim=config.d_model, hidden_dim=config.d_model, output_dim=4, num_layers=3
-                )
-                self.bbox_embed = nn.ModuleList([_bbox_embed for _ in range(config.decoder_layers)])
+            # each layer has its own head (implicit deep copy through a new instance)
+            self.bbox_embed = nn.ModuleList(
+                [
+                    GroundingDinoMLPPredictionHead(
+                        input_dim=config.d_model,
+                        hidden_dim=config.d_model,
+                        output_dim=4,
+                        num_layers=3,
+                    )
+                    for _ in range(config.decoder_layers)
+                ]
+            )
+
         self.class_embed = nn.ModuleList([_class_embed for _ in range(config.decoder_layers)])
         # hack for box-refinement
         self.model.decoder.bbox_embed = self.bbox_embed
Repository: denoland/deno
Pull request: fix(ext/webstorage): use error class for sqlite error case

Fixes #26797

Changed files:
filename: runtime/errors.rs
patch: @@ -623,7 +623,7 @@ fn get_ffi_call_error_class(e: &CallError) -> &'static str {
 fn get_webstorage_class_name(e: &WebStorageError) -> &'static str {
   match e {
     WebStorageError::ContextNotSupported => "DOMExceptionNotSupportedError",
-    WebStorageError::Sqlite(_) => todo!(),
+    WebStorageError::Sqlite(_) => "Error",
     WebStorageError::Io(e) => get_io_error_class(e),
     WebStorageError::StorageExceeded => "DOMExceptionQuotaExceededError",
   }
Repository: ggml-org/llama.cpp
Pull request: server: Fixed speculative decoding stats to use `#accepted \ #tested` rather than `#accepted \ #drafted`

Fixes https://github.com/ggml-org/llama.cpp/issues/14048

The existing printout of "draft acceptance rate" is misleading, as it is counting those tokens that were skipped due to the `--draft-min` setting:

```cpp
                // keep track of total number of tokens generated in the draft
                slot.n_draft_total += draft.size();

                // ignore small drafts
                if (slot.params.speculative.n_min > (int) draft.size()) {
                    SLT_DBG(slot, "ignoring small draft: %d < %d\n", (int) draft.size(), slot.params.speculative.n_min);

                    continue;
                }
```

This PR just moves the count increment to after this test so that "draft acceptance rate" becomes `#accepted \ #tested` rather than `#accepted \ #drafted`.

As I said ion the other thread, we could add a separate `#accepted \ #drafted` stat, but this too would be misleading as there is code in `speculative.cpp` to reuse the drafted tokens...

Changed files:
filename: tools/server/server.cpp
patch: @@ -3556,16 +3556,16 @@ struct server_context {
                 const llama_tokens & cached_text_tokens = slot.cache_tokens.get_text_tokens();
                 llama_tokens draft = common_speculative_gen_draft(slot.spec, params_spec, cached_text_tokens, id);
 
-                // keep track of total number of tokens generated in the draft
-                slot.n_draft_total += draft.size();
-
                 // ignore small drafts
                 if (slot.params.speculative.n_min > (int) draft.size()) {
                     SLT_DBG(slot, "ignoring small draft: %d < %d\n", (int) draft.size(), slot.params.speculative.n_min);
 
                     continue;
                 }
 
+                // keep track of total number of drafted tokens tested
+                slot.n_draft_total += draft.size();
+
                 // construct the speculation batch
                 common_batch_clear(slot.batch_spec);
                 common_batch_add  (slot.batch_spec, id, slot.n_past, { slot.id }, true);
@@ -3584,7 +3584,7 @@ struct server_context {
                 slot.n_past    += ids.size();
                 slot.n_decoded += ids.size();
 
-                // update how many tokens out of draft was accepted
+                // update how many tokens out of those tested were accepted
                 slot.n_draft_accepted += ids.size() - 1;
 
                 slot.cache_tokens.push_back(id);
Repository: ggml-org/llama.cpp
Pull request: cmake : bump llguidance version to v1.0.1

Now that LLGuidance has an [official "stable" release](https://github.com/guidance-ai/llguidance/blob/v1.0.1/CHANGELOG.md?plain=1#L7-L17), we might use that version as well.

Tested with `test-grammar-llguidance` and `ggml-vocab-llama-bpe.gguf` and `ggml-vocab-deepseek-llm.gguf` vocab models.

Changed files:
filename: common/CMakeLists.txt
patch: @@ -112,8 +112,8 @@ if (LLAMA_LLGUIDANCE)
 
     ExternalProject_Add(llguidance_ext
         GIT_REPOSITORY https://github.com/guidance-ai/llguidance
-        # v0.7.20 (+ fix to build on GCC 15):
-        GIT_TAG b5b8b64dba11c4e4ee6b1d1450d3a3ae279891e8
+        # v1.0.1:
+        GIT_TAG d795912fedc7d393de740177ea9ea761e7905774
         PREFIX ${CMAKE_BINARY_DIR}/llguidance
         SOURCE_DIR ${LLGUIDANCE_SRC}
         BUILD_IN_SOURCE TRUE
Repository: electron/electron
Pull request: fix: update shell.openExternal to correctly focus on external window

Backport of #44408

See that PR for details.


Notes: Fix external window focus when using shell.openExternal

Changed files:
filename: docs/api/base-window.md
patch: @@ -512,7 +512,7 @@ Sets the content view of the window.
 
 #### `win.getContentView()`
 
-Returns [`View`](view.md) - The content view of the window.
+Returns [View](view.md) - The content view of the window.
 
 #### `win.destroy()`
 

filename: shell/common/platform_util_mac.mm
patch: @@ -19,6 +19,7 @@
 #include "base/logging.h"
 #include "base/mac/scoped_aedesc.h"
 #include "base/strings/sys_string_conversions.h"
+#include "base/task/sequenced_task_runner.h"
 #include "base/task/thread_pool.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "electron/mas.h"
@@ -147,11 +148,27 @@ void OpenExternal(const GURL& url,
     return;
   }
 
-  bool success = [[NSWorkspace sharedWorkspace] openURL:ns_url];
-  if (success && options.activate)
-    [NSApp activateIgnoringOtherApps:YES];
+  NSWorkspaceOpenConfiguration* configuration =
+      [NSWorkspaceOpenConfiguration configuration];
+  configuration.activates = options.activate;
+
+  __block OpenCallback copied_callback = std::move(callback);
+  scoped_refptr<base::SequencedTaskRunner> runner =
+      base::SequencedTaskRunner::GetCurrentDefault();
 
-  std::move(callback).Run(success ? "" : "Failed to open URL");
+  [[NSWorkspace sharedWorkspace]
+                openURL:ns_url
+          configuration:configuration
+      completionHandler:^(NSRunningApplication* _Nullable app,
+                          NSError* _Nullable error) {
+        if (error) {
+          runner->PostTask(FROM_HERE, base::BindOnce(std::move(copied_callback),
+                                                     "Failed to open URL"));
+        } else {
+          runner->PostTask(FROM_HERE,
+                           base::BindOnce(std::move(copied_callback), ""));
+        }
+      }];
 }
 
 bool MoveItemToTrashWithError(const base::FilePath& full_path,

filename: spec/api-shell-spec.ts
patch: @@ -76,6 +76,21 @@ describe('shell module', () => {
         requestReceived
       ]);
     });
+
+    ifit(process.platform === 'darwin')('removes focus from the electron window after opening an external link', async () => {
+      const url = 'http://127.0.0.1';
+      const w = new BrowserWindow({ show: true });
+
+      await once(w, 'focus');
+      expect(w.isFocused()).to.be.true();
+
+      await Promise.all<void>([
+        shell.openExternal(url),
+        once(w, 'blur') as Promise<any>
+      ]);
+
+      expect(w.isFocused()).to.be.false();
+    });
   });
 
   describe('shell.trashItem()', () => {
Repository: denoland/deno
Pull request: fix(ext/cache): don't panic when creating cache

Wire up errors to JS instead of panicking.

Fixes https://github.com/denoland/deno/issues/26775


Changed files:
filename: ext/cache/lib.rs
patch: @@ -33,7 +33,9 @@ pub enum CacheError {
 }
 
 #[derive(Clone)]
-pub struct CreateCache<C: Cache + 'static>(pub Arc<dyn Fn() -> C>);
+pub struct CreateCache<C: Cache + 'static>(
+  pub Arc<dyn Fn() -> Result<C, CacheError>>,
+);
 
 deno_core::extension!(deno_cache,
   deps = [ deno_webidl, deno_web, deno_url, deno_fetch ],
@@ -231,7 +233,7 @@ where
   if let Some(cache) = state.try_borrow::<CA>() {
     Ok(cache.clone())
   } else if let Some(create_cache) = state.try_borrow::<CreateCache<CA>>() {
-    let cache = create_cache.0();
+    let cache = create_cache.0()?;
     state.put(cache);
     Ok(state.borrow::<CA>().clone())
   } else {

filename: ext/cache/sqlite.rs
patch: @@ -42,7 +42,7 @@ pub struct SqliteBackedCache {
 }
 
 impl SqliteBackedCache {
-  pub fn new(cache_storage_dir: PathBuf) -> Self {
+  pub fn new(cache_storage_dir: PathBuf) -> Result<Self, CacheError> {
     {
       std::fs::create_dir_all(&cache_storage_dir)
         .expect("failed to create cache dir");
@@ -57,18 +57,14 @@ impl SqliteBackedCache {
         PRAGMA synchronous=NORMAL;
         PRAGMA optimize;
       ";
-      connection
-        .execute_batch(initial_pragmas)
-        .expect("failed to execute pragmas");
-      connection
-        .execute(
-          "CREATE TABLE IF NOT EXISTS cache_storage (
+      connection.execute_batch(initial_pragmas)?;
+      connection.execute(
+        "CREATE TABLE IF NOT EXISTS cache_storage (
                     id              INTEGER PRIMARY KEY,
                     cache_name      TEXT NOT NULL UNIQUE
                 )",
-          (),
-        )
-        .expect("failed to create cache_storage table");
+        (),
+      )?;
       connection
         .execute(
           "CREATE TABLE IF NOT EXISTS request_response_list (
@@ -86,12 +82,11 @@ impl SqliteBackedCache {
                     UNIQUE (cache_id, request_url)
                 )",
           (),
-        )
-        .expect("failed to create request_response_list table");
-      SqliteBackedCache {
+        )?;
+      Ok(SqliteBackedCache {
         connection: Arc::new(Mutex::new(connection)),
         cache_storage_dir,
-      }
+      })
     }
   }
 }
Repository: ggml-org/llama.cpp
Pull request: cmake : llguidance build parser library only

The LLGuidance repo contains a lot of stuffs, while the parser library we care about (`libllguidance.a` and `llguidance.h`) is only a small portion of it, under `parser` directory as per [project README](https://github.com/guidance-ai/llguidance/blob/v1.0.1/README.md#building), thus building the whole project when building llama.cpp is unnecessary and a waste of time and compute power. This PR instructs CMake to only build the parser library, which cuts the number of compiled Rust packages from ~300 to 75, and provides a ~40% overall build speed increase.

Tested with a GitHub Codespace with 2 vCPUs, 8GB RAM, and llama.cpp b5857 with default CMake config (`cmake . -B build -DLLAMA_LLGUIDANCE=ON && time cmake --build build -j $(nproc)`):

Before (b5857):
```
real    11m3.258s
user    17m34.982s
sys     1m11.124s
```

After (this PR):
```
real    6m38.164s
user    10m23.589s
sys     0m41.985s
```

Changed files:
filename: common/CMakeLists.txt
patch: @@ -118,7 +118,7 @@ if (LLAMA_LLGUIDANCE)
         SOURCE_DIR ${LLGUIDANCE_SRC}
         BUILD_IN_SOURCE TRUE
         CONFIGURE_COMMAND ""
-        BUILD_COMMAND cargo build --release
+        BUILD_COMMAND cargo build --release --package llguidance
         INSTALL_COMMAND ""
         BUILD_BYPRODUCTS ${LLGUIDANCE_PATH}/${LLGUIDANCE_LIB_NAME} ${LLGUIDANCE_PATH}/llguidance.h
         UPDATE_COMMAND ""
Repository: facebook/react
Pull request: Changelog for 18.1

Assumes #24404 is merged.
Needs a date in the header before merge.

Changed files:
filename: CHANGELOG.md
patch: @@ -1,3 +1,32 @@
+## 18.1.0 (TODO)
+
+### React DOM
+
+* Fix the false positive warning about `react-dom/client` when using UMD bundle. ([@alireza-molaee](https://github.com/alireza-molaee) in [#24274](https://github.com/facebook/react/pull/24274))
+* Fix `suppressHydrationWarning` to work in production too. ([@gaearon](https://github.com/gaearon) in [#24271](https://github.com/facebook/react/pull/24271))
+* Fix `componentWillUnmount` firing twice inside of Suspense. ([@acdlite](https://github.com/acdlite) in [#24308](https://github.com/facebook/react/pull/24308))
+* Fix some transition updates being ignored. ([@acdlite](https://github.com/acdlite) in [#24353](https://github.com/facebook/react/pull/24353))
+* Fix `useDeferredValue` causing an infinite loop when passed an unmemoized value. ([@acdlite](https://github.com/acdlite) in [#24247](https://github.com/facebook/react/pull/24247))
+* Fix throttling of revealing Suspense fallbacks. ([@sunderls](https://github.com/sunderls) in [#24253](https://github.com/facebook/react/pull/24253))
+* Fix a missing warning about a `setState` loop in `useEffect`. ([@gaearon](https://github.com/gaearon) in [#24298](https://github.com/facebook/react/pull/24298))
+* Fix a spurious hydration error. ([@gnoff](https://github.com/gnoff) in [#24404](https://github.com/facebook/react/pull/24404))
+* Warn when calling `setState` in `useInsertionEffect`. ([@gaearon](https://github.com/gaearon) in [#24295](https://github.com/facebook/react/pull/24295))
+* Ensure the reason for hydration errors is always displayed. ([@gaearon](https://github.com/gaearon) in [#24276](https://github.com/facebook/react/pull/24276))
+
+### React DOM Server
+
+* Fix escaping for the `bootstrapScriptContent` contents. ([@gnoff](https://github.com/gnoff) in [#24385](https://github.com/facebook/react/pull/24385))
+* Significantly improve performance of `renderToPipeableStream`. ([@gnoff](https://github.com/gnoff) in [#24291](https://github.com/facebook/react/pull/24291))
+
+### ESLint Plugin: React Hooks
+
+* Fix false positive errors with a large number of branches. ([@scyron6](https://github.com/scyron6) in [#24287](https://github.com/facebook/react/pull/24287))
+* Don't consider a known dependency stable when the variable is reassigned. ([@afzalsayed96](https://github.com/afzalsayed96) in [#24343](https://github.com/facebook/react/pull/24343))
+
+### Use Subscription
+
+* Replace the implementation with the `use-sync-external-store` shim. ([@gaearon](https://github.com/gaearon) in [#24289](https://github.com/facebook/react/pull/24289))
+
 ## 18.0.0 (March 29, 2022)
 
 Below is a list of all new features, APIs, deprecations, and breaking changes.
Repository: huggingface/transformers
Pull request: fix: handle no scheduler passed by user

cc @kashif 

Changed files:
filename: src/transformers/generation/continuous_batching.py
patch: @@ -1270,9 +1270,14 @@ def _run_generation_loop(self):
                 self.model.dtype,
             )
 
-            scheduler = SCHEDULER_MAPPING.get(self.generation_config.scheduler)
-            if scheduler is None:
-                logger.warning(f"Scheduler '{scheduler}' not found. Defaulting to FIFO.")
+            scheduler = None
+            if hasattr(self.generation_config, "scheduler"):
+                scheduler = SCHEDULER_MAPPING.get(self.generation_config.scheduler)
+                if scheduler is None:
+                    logger.warning(f"Scheduler '{scheduler}' not found. Defaulting to FIFO.")
+                    scheduler = FIFOScheduler
+            else:
+                # Default to fifo
                 scheduler = FIFOScheduler
 
             batch_processor = ContinuousBatchProcessor(
Repository: huggingface/transformers
Pull request: [Qwen2.5-Omni] Fix dtype of cos,sin when used with flash attention

# What does this PR do?

Fixes a dtype mismatch in **Qwen2.5-Omni** models when Flash Attention is enabled:  
`sin` and `cos` positional embeddings are now explicitly cast to the same dtype as the working tensor.

**Related issue:** [#38451](https://github.com/huggingface/transformers/issues/38451)

Thanks @zucchini-nlp for validating the fix!

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] 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.

Changed files:
filename: src/transformers/models/qwen2_5_omni/modeling_qwen2_5_omni.py
patch: @@ -1034,8 +1034,8 @@ def __init__(self, dim: int, num_heads: int = 16) -> None:
 
     def _apply_rotary_pos_emb_flashatt(self, tensor: torch.Tensor, freqs: torch.Tensor) -> torch.Tensor:
         tensor_ = tensor.float()
-        cos = freqs.cos()  # .type_as(tensor_)
-        sin = freqs.sin()  # .type_as(tensor_)
+        cos = freqs.cos().type_as(tensor_)
+        sin = freqs.sin().type_as(tensor_)
         output = apply_rotary_emb(tensor_, cos, sin).type_as(tensor)
         return output
 

filename: src/transformers/models/qwen2_5_omni/modular_qwen2_5_omni.py
patch: @@ -2022,8 +2022,8 @@ def __init__(self, dim: int, num_heads: int = 16) -> None:
 
     def _apply_rotary_pos_emb_flashatt(self, tensor: torch.Tensor, freqs: torch.Tensor) -> torch.Tensor:
         tensor_ = tensor.float()
-        cos = freqs.cos()  # .type_as(tensor_)
-        sin = freqs.sin()  # .type_as(tensor_)
+        cos = freqs.cos().type_as(tensor_)
+        sin = freqs.sin().type_as(tensor_)
         output = apply_rotary_emb(tensor_, cos, sin).type_as(tensor)
         return output
Repository: electron/electron
Pull request: perf: remove isolate scope from DidProcessTask()

Backport of #44439

See that PR for details.


Notes: Performance improvements when processing microtasks.

Changed files:
filename: shell/browser/microtasks_runner.cc
patch: @@ -18,7 +18,6 @@ void MicrotasksRunner::WillProcessTask(const base::PendingTask& pending_task,
                                        bool was_blocked_or_low_priority) {}
 
 void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) {
-  v8::Isolate::Scope scope(isolate_);
   // In the browser process we follow Node.js microtask policy of kExplicit
   // and let the MicrotaskRunner which is a task observer for chromium UI thread
   // scheduler run the microtask checkpoint. This worked fine because Node.js
Repository: vercel/next.js
Pull request: Update font data

This auto-generated PR updates font data with latest available

Changed files:
filename: packages/font/src/google/font-data.json
patch: @@ -6043,7 +6043,14 @@
         "defaultValue": 0
       }
     ],
-    "subsets": ["cyrillic", "cyrillic-ext", "latin", "latin-ext", "vietnamese"]
+    "subsets": [
+      "cyrillic",
+      "cyrillic-ext",
+      "emoji",
+      "latin",
+      "latin-ext",
+      "vietnamese"
+    ]
   },
   "Kadwa": {
     "weights": ["400", "700"],

filename: packages/font/src/google/index.ts
patch: @@ -10540,7 +10540,7 @@ export declare function Kablammo<
   fallback?: string[]
   adjustFontFallback?: boolean
   subsets?: Array<
-    'cyrillic' | 'cyrillic-ext' | 'latin' | 'latin-ext' | 'vietnamese'
+    'cyrillic' | 'cyrillic-ext' | 'emoji' | 'latin' | 'latin-ext' | 'vietnamese'
   >
   axes?: 'MORF'[]
 }): T extends undefined ? NextFont : NextFontWithVariable
Repository: facebook/react
Pull request: Remove React 18 issue template

React 18 is just React now.



Changed files:
filename: .github/ISSUE_TEMPLATE/react_18.md
patch: @@ -1,11 +0,0 @@
----
-name: "💬 React 18"
-about: Bug reports, questions, and general feedback about React 18
-title: 'React 18 '
-labels: 'Type: Discussion, React 18'
-
----
-
-<!--
-  Ask a question or share feedback about the React 18 release here.
--->
Repository: ggml-org/llama.cpp
Pull request: ggml : prevent integer overflow in tensor size calculation

Add a check to prevent integer overflow when accumulating tensor sizes in gguf_init_from_file_impl. 
This avoids potential oob read/write from malformed GGUF files.

Changed files:
filename: ggml/src/gguf.cpp
patch: @@ -631,7 +631,14 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par
                 gguf_free(ctx);
                 return nullptr;
             }
-            ctx->size += GGML_PAD(ggml_nbytes(&ti.t), ctx->alignment);
+            size_t padded_size = GGML_PAD(ggml_nbytes(&ti.t), ctx->alignment);
+            if (SIZE_MAX - ctx->size < padded_size) {
+                GGML_LOG_ERROR("%s: tensor '%s' size overflow, cannot accumulate size %zu + %zu\n",
+                    __func__, ti.t.name, ctx->size, padded_size);
+                gguf_free(ctx);
+                return nullptr;
+            }
+            ctx->size += padded_size;
         }
     }