helloadhavan/github_issues huggingface dataset:
Repository: vuejs/vue
Pull request: Fix broken todomvc test

Same patch as vuejs/vuex#296


Changed files:
filename: package.json
patch: @@ -51,7 +51,7 @@
     "babel-core": "^5.8.0",
     "babel-loader": "^5.4.0",
     "babel-runtime": "^5.8.0",
-    "casperjs": "^1.1.0-beta5",
+    "casperjs": "^1.1.3",
     "codecov.io": "^0.1.2",
     "eslint": "^2.9.0",
     "eslint-config-vue": "^1.0.0",

filename: test/e2e/todomvc.js
patch: @@ -4,6 +4,7 @@ casper.test.begin('todomvc', 63, function (test) {
   casper
   .start('examples/todomvc/index.html')
   .then(function () {
+    this.viewport(1000, 1000) // for appearing destroy buttons by mouse hover
     test.assertNotVisible('.main', '.main should be hidden')
     test.assertNotVisible('.footer', '.footer should be hidden')
     test.assertElementCount('.filters .selected', 1, 'should have one filter selected')
@@ -90,6 +91,9 @@ casper.test.begin('todomvc', 63, function (test) {
 
   // remove a completed item --------------------------------------------
 
+  .then(function () {
+    this.mouse.move('.todo:nth-child(1)')
+  })
   .thenClick('.todo:nth-child(1) .destroy', function () {
     test.assertElementCount('.todo', 4, 'should have 4 items now')
     test.assertElementCount('.todo.completed', 2, 'should have 2 item completed')
@@ -98,6 +102,9 @@ casper.test.begin('todomvc', 63, function (test) {
 
   // remove a incompleted item ------------------------------------------
 
+  .then(function () {
+    this.mouse.move('.todo:nth-child(2)')
+  })
   .thenClick('.todo:nth-child(2) .destroy', function () {
     test.assertElementCount('.todo', 3, 'should have 3 items now')
     test.assertElementCount('.todo.completed', 2, 'should have 2 item completed')
Repository: electron/electron
Pull request: fix: set ozone platform for wayland

Backport of #48301

See that PR for details.


Notes: Fixed Wayland configuration through the `XDG_SESSION_TYPE` environment variable.

Changed files:
filename: BUILD.gn
patch: @@ -655,6 +655,7 @@ source_set("electron_lib") {
       "//ui/events/devices/x11",
       "//ui/events/platform/x11",
       "//ui/gtk:gtk_config",
+      "//ui/linux:display_server_utils",
       "//ui/linux:linux_ui",
       "//ui/linux:linux_ui_factory",
       "//ui/wm",

filename: shell/browser/electron_browser_main_parts.cc
patch: @@ -67,6 +67,7 @@
 #include "ui/base/ui_base_switches.h"
 #include "ui/color/color_provider_manager.h"
 #include "ui/display/screen.h"
+#include "ui/linux/display_server_utils.h"
 #include "ui/views/layout/layout_provider.h"
 #include "url/url_util.h"
 
@@ -207,9 +208,14 @@ int ElectronBrowserMainParts::PreEarlyInitialization() {
 #if BUILDFLAG(IS_POSIX)
   HandleSIGCHLD();
 #endif
+#if BUILDFLAG(IS_OZONE)
+  // Initialize Ozone platform and add required feature flags as per platform's
+  // properties.
 #if BUILDFLAG(IS_LINUX)
-  ui::OzonePlatform::PreEarlyInitialization();
+  ui::SetOzonePlatformForLinuxIfNeeded(*base::CommandLine::ForCurrentProcess());
 #endif
+  ui::OzonePlatform::PreEarlyInitialization();
+#endif  // BUILDFLAG(IS_OZONE)
 #if BUILDFLAG(IS_MAC)
   screen_ = std::make_unique<display::ScopedNativeScreen>();
 #endif
Repository: vuejs/vue
Pull request: camelize comment typo (#3696)

 **delmited** => **delimited**


Changed files:
filename: src/util/lang.js
patch: @@ -167,7 +167,7 @@ export function stripQuotes (str) {
 }
 
 /**
- * Camelize a hyphen-delmited string.
+ * Camelize a hyphen-delimited string.
  *
  * @param {String} str
  * @return {String}
Repository: facebook/react
Pull request: (cherrypick) [Flight Reply] Reject any new Chunks not yet discovered at the time of reportGlobalError (#31840)

We might have already resolved models that are not pending and so are not rejected by aborting the stream. When those later get parsed they might discover new chunks which end up as pending. These should be errored since they will never be able to resolve later.

This avoids infinitely hanging the stream.

This same fix needs to be ported to ReactFlightClient that has the same issue.

Changed files:
filename: packages/react-server/src/ReactFlightReplyServer.js
patch: @@ -135,6 +135,8 @@ export type Response = {
   _formData: FormData,
   _chunks: Map<number, SomeChunk<any>>,
   _fromJSON: (key: string, value: JSONValue) => any,
+  _closed: boolean,
+  _closedReason: mixed,
 };
 
 export function getRoot<T>(response: Response): Thenable<T> {
@@ -198,6 +200,14 @@ function createResolvedModelChunk<T>(
   return new Chunk(RESOLVED_MODEL, value, null, response);
 }
 
+function createErroredChunk<T>(
+  response: Response,
+  reason: mixed,
+): ErroredChunk<T> {
+  // $FlowFixMe[invalid-constructor] Flow doesn't support functions as constructors
+  return new Chunk(ERRORED, null, reason, response);
+}
+
 function resolveModelChunk<T>(chunk: SomeChunk<T>, value: string): void {
   if (chunk.status !== PENDING) {
     // We already resolved. We didn't expect to see this.
@@ -297,6 +307,8 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
 // Report that any missing chunks in the model is now going to throw this
 // error upon read. Also notify any pending promises.
 export function reportGlobalError(response: Response, error: Error): void {
+  response._closed = true;
+  response._closedReason = error;
   response._chunks.forEach(chunk => {
     // If this chunk was already resolved or errored, it won't
     // trigger an error but if it wasn't then we need to
@@ -318,6 +330,10 @@ function getChunk(response: Response, id: number): SomeChunk<any> {
     if (backingEntry != null) {
       // We assume that this is a string entry for now.
       chunk = createResolvedModelChunk(response, (backingEntry: any));
+    } else if (response._closed) {
+      // We have already errored the response and we're not going to get
+      // anything more streaming in so this will immediately error.
+      chunk = createErroredChunk(response, response._closedReason);
     } else {
       // We're still waiting on this entry to stream in.
       chunk = createPendingChunk(response);
@@ -519,6 +535,8 @@ export function createResponse(
       }
       return value;
     },
+    _closed: false,
+    _closedReason: null,
   };
   return response;
 }
Repository: electron/electron
Pull request: fix: set ozone platform for wayland

#### Description of Change

In a recent upgrade roll I made a [breaking change](https://www.electronjs.org/docs/latest/breaking-changes#removed-electron_ozone_platform_hint-environment-variable) to remove the custom `ELECTRON_OZONE_PLATFORM_HINT` env var and directed users to use the `XDG_SESSION_TYPE` env var instead. However, I forgot to ensure that [function](https://source.chromium.org/chromium/chromium/src/+/main:ui/linux/display_server_utils.cc?q=symbol%3A%5Cbui%3A%3ASetOzonePlatformForLinuxIfNeeded%5Cb%20case%3Ayes) to use that env var was called. Thus, this PR calls that function during startup.

The code in this PR mirrors the [corresponding upstream code](https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/chrome_main_delegate.cc;l=810-817;drc=61b367b8b73a1db50dbeca05a5ec0e5f776e6443).

Fixes #48298
Refs #48001

#### Checklist

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Fixed Wayland configuration through the `XDG_SESSION_TYPE` environment variable.

Changed files:
filename: BUILD.gn
patch: @@ -655,6 +655,7 @@ source_set("electron_lib") {
       "//ui/events/devices/x11",
       "//ui/events/platform/x11",
       "//ui/gtk:gtk_config",
+      "//ui/linux:display_server_utils",
       "//ui/linux:linux_ui",
       "//ui/linux:linux_ui_factory",
       "//ui/wm",

filename: shell/browser/electron_browser_main_parts.cc
patch: @@ -68,6 +68,7 @@
 #include "ui/base/ui_base_switches.h"
 #include "ui/color/color_provider_manager.h"
 #include "ui/display/screen.h"
+#include "ui/linux/display_server_utils.h"
 #include "ui/views/layout/layout_provider.h"
 #include "url/url_util.h"
 
@@ -209,9 +210,14 @@ int ElectronBrowserMainParts::PreEarlyInitialization() {
 #if BUILDFLAG(IS_POSIX)
   HandleSIGCHLD();
 #endif
+#if BUILDFLAG(IS_OZONE)
+  // Initialize Ozone platform and add required feature flags as per platform's
+  // properties.
 #if BUILDFLAG(IS_LINUX)
-  ui::OzonePlatform::PreEarlyInitialization();
+  ui::SetOzonePlatformForLinuxIfNeeded(*base::CommandLine::ForCurrentProcess());
 #endif
+  ui::OzonePlatform::PreEarlyInitialization();
+#endif  // BUILDFLAG(IS_OZONE)
 #if BUILDFLAG(IS_MAC)
   screen_ = std::make_unique<display::ScopedNativeScreen>();
 #endif
Repository: ggml-org/llama.cpp
Pull request: chat: fix language input for translategemma

Example request with text input:

```json
{
  "messages": [
    {
      "role": "user",
      "content": "hi"
    }
  ],
  "chat_template_kwargs": { 
    "source_lang_code": "cs",
    "target_lang_code": "zh"
  }
}
```

With image input:


```json
{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image_url",
          "image_url": {
            "url": "https://huggingface.co/ggml-org/tinygemma3-GGUF/resolve/main/test/91_cat.png"
          }
        }
      ]
    }
  ],
  "chat_template_kwargs": { 
    "source_lang_code": "cs",
    "target_lang_code": "zh"
  }
}
```

With both text and image:

```json
{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "this is a test"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://huggingface.co/ggml-org/tinygemma3-GGUF/resolve/main/test/91_cat.png"
          }
        }
      ]
    }
  ],
  "chat_template_kwargs": { 
    "source_lang_code": "cs",
    "target_lang_code": "zh"
  }
}
```

Changed files:
filename: common/chat.cpp
patch: @@ -2659,6 +2659,10 @@ static common_chat_params common_chat_params_init_translate_gemma(const common_c
     templates_params inputs_new = inputs;
     json & messages = inputs_new.messages;
 
+    // default to chat_template_kwargs, or en-GB if not specified
+    std::string default_src_lang = inputs.extra_context.value("source_lang_code", "en-GB");
+    std::string default_tgt_lang = inputs.extra_context.value("target_lang_code", "en-GB");
+
     GGML_ASSERT(messages.is_array());
     for (auto & message : messages) {
         if (message.contains("role") && message["role"].get<std::string>() != "user") {
@@ -2670,8 +2674,10 @@ static common_chat_params common_chat_params_init_translate_gemma(const common_c
         if (message.contains("content") && !message["content"].is_array()) {
             auto content_str = message["content"].get<std::string>();
             // default to en-GB if not specified (to make common_chat_format_example works)
-            auto src_lang = message.contains("source_lang_code") ? message["source_lang_code"].get<std::string>() : "en-GB";
-            auto tgt_lang = message.contains("target_lang_code") ? message["target_lang_code"].get<std::string>() : "en-GB";
+            auto src_lang = message.contains("source_lang_code")
+                        ? message["source_lang_code"].get<std::string>() : default_src_lang;
+            auto tgt_lang = message.contains("target_lang_code")
+                        ? message["target_lang_code"].get<std::string>() : default_tgt_lang;
             message["content"] = json::array({
                 json{
                     {"type", "text"},
Repository: huggingface/transformers
Pull request: fix the issue that the output dict of jit model could not get [0]

# What does this PR do?


Fixes # (issue)
when the model is optimized by jit.trace. and then used in pipeline inference for token classification. there is error like KeyError: 0,

## 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#start-contributing-pull-requests),
      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.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

- pipelines: @Narsil



Changed files:
filename: src/transformers/pipelines/token_classification.py
patch: @@ -239,7 +239,8 @@ def _forward(self, model_inputs):
         if self.framework == "tf":
             logits = self.model(model_inputs.data)[0]
         else:
-            logits = self.model(**model_inputs)[0]
+            output = self.model(**model_inputs)
+            logits = output["logits"] if isinstance(output, dict) else output[0]
 
         return {
             "logits": logits,
Repository: vuejs/vue
Pull request: grammar fix


Changed files:
filename: src/directives/public/for.js
patch: @@ -152,7 +152,7 @@ const vFor = {
             frag.scope[alias] = value
           })
         }
-      } else { // new isntance
+      } else { // new instance
         frag = this.create(value, alias, i, key)
         frag.fresh = !init
       }
Repository: electron/electron
Pull request: build: fixup chromedriver and mksnapshot

Backport of #48470

See that PR for details.


Notes: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->none


Changed files:
filename: .github/actions/build-electron/action.yml
patch: @@ -79,7 +79,7 @@ runs:
       shell: bash
       run: |
         cd src
-        e build --target electron:electron_mksnapshot
+        e build --target electron:electron_mksnapshot_zip
         ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
         # Remove unused args from mksnapshot_args
         SEDOPTION="-i"
@@ -89,7 +89,6 @@ runs:
         sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
         sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
 
-        e build --target electron:electron_mksnapshot_zip
         if [ "${{ inputs.target-platform }}" = "win" ]; then
           cd out/Default
           powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
@@ -123,7 +122,6 @@ runs:
       shell: bash
       run: |
         cd src
-        e build --target electron:electron_chromedriver
         e build --target electron:electron_chromedriver_zip
 
         if [ "${{ inputs.is-asan }}" != "true" ]; then

filename: .github/actions/install-build-tools/action.yml
patch: @@ -15,7 +15,7 @@ runs:
         git config --global core.preloadindex true
         git config --global core.longpaths true
       fi
-      export BUILD_TOOLS_SHA=c13f4bdb50e65da46a4703f8f882079dd21fd99e
+      export BUILD_TOOLS_SHA=706147b2376f55078f718576b28129a0457f1795
       npm i -g @electron/build-tools
       # Update depot_tools to ensure python
       e d update_depot_tools

filename: .github/workflows/pipeline-segment-electron-test.yml
patch: @@ -177,22 +177,18 @@ jobs:
         path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
     - name: Restore Generated Artifacts
       run: ./src/electron/script/actions/restore-artifacts.sh
-    - name: Unzip Dist, Mksnapshot & Chromedriver (win)
+    - name: Unzip Dist (win)
       if: ${{ inputs.target-platform == 'win' }}
       shell: powershell
       run: |
         Set-ExecutionPolicy Bypass -Scope Process -Force
         cd src/out/Default
         Expand-Archive -Force dist.zip -DestinationPath ./
-        Expand-Archive -Force chromedriver.zip -DestinationPath ./
-        Expand-Archive -Force mksnapshot.zip -DestinationPath ./
-    - name: Unzip Dist, Mksnapshot & Chromedriver (unix)
+    - name: Unzip Dist (unix)
       if: ${{ inputs.target-platform != 'win' }}
       run: |
         cd src/out/Default
         unzip -:o dist.zip
-        unzip -:o chromedriver.zip
-        unzip -:o mksnapshot.zip
     #- name: Import & Trust Self-Signed Codesigning Cert on MacOS
     #  if: ${{ inputs.target-platform == 'macos' && inputs.target-arch == 'x64' }}
     #  run: |
Repository: facebook/react
Pull request: [compiler] Allow type cast expressions with refs

We report a false positive for the combination of a ref-accessing function placed inside an array which is they type-cast. Here we teach ref validation about type casts. I also tried other variants like `return ref as const` but those already worked.

Closes #31864

Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoRefAccesInRender.ts
patch: @@ -305,6 +305,14 @@ function validateNoRefAccessInRenderImpl(
             );
             break;
           }
+          case 'TypeCastExpression': {
+            env.set(
+              instr.lvalue.identifier.id,
+              env.get(instr.value.value.identifier.id) ??
+                refTypeOfType(instr.lvalue),
+            );
+            break;
+          }
           case 'LoadContext':
           case 'LoadLocal': {
             env.set(

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-ref-type-cast-in-render.expect.md
patch: @@ -0,0 +1,60 @@
+
+## Input
+
+```javascript
+import {useRef} from 'react';
+
+function useArrayOfRef() {
+  const ref = useRef(null);
+  const callback = value => {
+    ref.current = value;
+  };
+  return [callback] as const;
+}
+
+export const FIXTURE_ENTRYPOINT = {
+  fn: () => {
+    useArrayOfRef();
+    return 'ok';
+  },
+  params: [{}],
+};
+
+```
+
+## Code
+
+```javascript
+import { c as _c } from "react/compiler-runtime";
+import { useRef } from "react";
+
+function useArrayOfRef() {
+  const $ = _c(1);
+  const ref = useRef(null);
+  let t0;
+  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
+    const callback = (value) => {
+      ref.current = value;
+    };
+
+    t0 = [callback];
+    $[0] = t0;
+  } else {
+    t0 = $[0];
+  }
+  return t0 as const;
+}
+
+export const FIXTURE_ENTRYPOINT = {
+  fn: () => {
+    useArrayOfRef();
+    return "ok";
+  },
+
+  params: [{}],
+};
+
+```
+      
+### Eval output
+(kind: ok) "ok"
\ No newline at end of file

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-ref-type-cast-in-render.js
patch: @@ -0,0 +1,17 @@
+import {useRef} from 'react';
+
+function useArrayOfRef() {
+  const ref = useRef(null);
+  const callback = value => {
+    ref.current = value;
+  };
+  return [callback] as const;
+}
+
+export const FIXTURE_ENTRYPOINT = {
+  fn: () => {
+    useArrayOfRef();
+    return 'ok';
+  },
+  params: [{}],
+};
Repository: nodejs/node
Pull request: tools: limit inspector protocol PR title length

Refs: https://github.com/nodejs/node/pull/60312

Changed files:
filename: tools/dep_updaters/update-inspector-protocol.sh
patch: @@ -37,7 +37,7 @@ python "$BASE_DIR/tools/inspector_protocol/roll.py" \
   --node_src_downstream "$BASE_DIR" \
   --force
 
-NEW_VERSION=$(grep "Revision:" "$DEPS_DIR/inspector_protocol/README.node" | sed -n "s/^Revision: \(\\w*\)/\1/p")
+NEW_VERSION=$(grep "Revision:" "$DEPS_DIR/inspector_protocol/README.node" | sed -n 's/^Revision: \([[:xdigit:]]\{36\}\).*$/\1/p')
 
 # Update the version number on maintaining-dependencies.md
 # and print the new version as the last line of the script as we need
Repository: vuejs/vue
Pull request: 修复单词错误

修复单词错误


Changed files:
filename: src/instance/internal/init.js
patch: @@ -68,7 +68,7 @@ export default function (Vue) {
 
     // fragment:
     // if this instance is compiled inside a Fragment, it
-    // needs to reigster itself as a child of that fragment
+    // needs to register itself as a child of that fragment
     // for attach/detach to work properly.
     this._frag = options._frag
     if (this._frag) {
Repository: huggingface/transformers
Pull request: fix the issue that the output dict of jit model could not get [:2]

"TypeError: unhashable type: 'slice'"

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

- pipelines: @Narsil



Changed files:
filename: src/transformers/pipelines/question_answering.py
patch: @@ -509,8 +509,12 @@ def preprocess(self, example, padding="do_not_pad", doc_stride=None, max_questio
     def _forward(self, inputs):
         example = inputs["example"]
         model_inputs = {k: inputs[k] for k in self.tokenizer.model_input_names}
-        start, end = self.model(**model_inputs)[:2]
-        return {"start": start, "end": end, "example": example, **inputs}
+        output = self.model(**model_inputs)
+        if isinstance(output, dict):
+            return {"start": output["start_logits"], "end": output["end_logits"], "example": example, **inputs}
+        else:
+            start, end = output[:2]
+            return {"start": start, "end": end, "example": example, **inputs}
 
     def postprocess(
         self,
Repository: vuejs/vue
Pull request: Add inserted hook type to directive option

A type of a new directive hook from 2.0-rc.5


Changed files:
filename: types/options.d.ts
patch: @@ -85,6 +85,7 @@ export type DirectiveFunction = (
 
 export interface DirectiveOptions {
   bind?: DirectiveFunction;
+  inserted?: DirectiveFunction;
   update?: DirectiveFunction;
   componentUpdated?: DirectiveFunction;
   unbind?: DirectiveFunction;

filename: types/test/options-test.ts
patch: @@ -109,6 +109,7 @@ Vue.component('component', {
   directives: {
     a: {
       bind() {},
+      inserted() {},
       update() {},
       componentMounted() {},
       unbind() {}
Repository: vercel/next.js
Pull request: switch to slice in createRuntimePrefetchTransformStream

It's safer to copy here than to pass a reference, because it's possible that the underlying chunk became detached. Accidentally tweaked this before landing #85595

Changed files:
filename: packages/next/src/server/app-render/app-render.tsx
patch: @@ -1129,7 +1129,7 @@ function createRuntimePrefetchTransformStream(
         controller.enqueue(replace)
         // If there are bytes in the currentChunk after the match enqueue them
         if (currentIndex + searchLen < currentChunk.length) {
-          controller.enqueue(currentChunk.subarray(currentIndex + searchLen))
+          controller.enqueue(currentChunk.slice(currentIndex + searchLen))
         }
         // If we have a next chunk we enqueue it now
         if (nextChunk) {