helloadhavan/github_issues huggingface dataset:
Repository: nodejs/node
Pull request: deps: support madvise(3C) across ALL illumos revisions

In illumos, madvise(3C) now takes `void *` for its first argument post-illumos#14418, but uses `caddr_t` pre-illumos#14418. This fix will detect if the illumos is pre-or-post-illumos#14418 so builds can work either way.

Cf. https://illumos.org/issues/14418

Changed files:
filename: common.gypi
patch: @@ -38,7 +38,7 @@
 
     # Reset this number to 0 on major V8 upgrades.
     # Increment by one for each non-official patch applied to deps/v8.
-    'v8_embedder_string': '-node.17',
+    'v8_embedder_string': '-node.18',
 
     ##### V8 defaults for Node.js #####
 

filename: deps/v8/src/base/platform/platform-posix.cc
patch: @@ -80,7 +80,19 @@
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
-#if defined(V8_OS_SOLARIS)
+/*
+ * NOTE: illumos starting with illumos#14418 (pushed April 20th, 2022)
+ * prototypes madvise(3C) properly with a `void *` first argument.
+ * The only way to detect this outside of configure-time checking is to
+ * check for the existence of MEMCNTL_SHARED, which gets defined for the first
+ * time in illumos#14418 under the same circumstances save _STRICT_POSIX, which
+ * thankfully neither Solaris nor illumos builds of Node or V8 do.
+ *
+ * If some future illumos push changes the MEMCNTL_SHARED assumptions made
+ * above, the illumos check below will have to be revisited.  This check
+ * will work on both pre-and-post illumos#14418 illumos environments.
+ */
+#if defined(V8_OS_SOLARIS) && !(defined(__illumos__) && defined(MEMCNTL_SHARED))
 #if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
 extern "C" int madvise(caddr_t, size_t, int);
 #else
Repository: vuejs/vue
Pull request: replace special terminators chars

replace terminator chars  \u2028 and \u2029 to avoid syntax error. fix #3895 


Changed files:
filename: src/compiler/parser/index.js
patch: @@ -22,6 +22,7 @@ const bindRE = /^:|^v-bind:/
 const onRE = /^@|^v-on:/
 const argRE = /:(.*)$/
 const modifierRE = /\.[^\.]+/g
+const specialNewlineRE = /\u2028|\u2029/g
 
 const decodeHTMLCached = cached(decodeHTML)
 
@@ -223,6 +224,8 @@ export function parse (
             text
           })
         } else {
+          // #3895 special character
+          text = text.replace(specialNewlineRE, '')
           currentParent.children.push({
             type: 3,
             text
Repository: ollama/ollama
Pull request: Fix context in /api/generate grows too much (#5980).

This PR fixes [Context in /api/generate response grows too big. #5980
](https://github.com/ollama/ollama/issues/5980)

Changed files:
filename: server/routes.go
patch: @@ -188,21 +188,20 @@ func (s *Server) GenerateHandler(c *gin.Context) {
 		}
 
 		var b bytes.Buffer
-		if err := tmpl.Execute(&b, values); err != nil {
-			c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
-			return
-		}
-
 		if req.Context != nil {
 			s, err := r.Detokenize(c.Request.Context(), req.Context)
 			if err != nil {
 				c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
 				return
 			}
-
 			b.WriteString(s)
 		}
 
+		if err := tmpl.Execute(&b, values); err != nil {
+			c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
+			return
+		}
+
 		prompt = b.String()
 	}
 
@@ -247,7 +246,7 @@ func (s *Server) GenerateHandler(c *gin.Context) {
 						ch <- gin.H{"error": err.Error()}
 						return
 					}
-					res.Context = append(req.Context, tokens...)
+					res.Context = tokens
 				}
 			}
Repository: ollama/ollama
Pull request: llama: Get embeddings working

Truncation doesn't pass, but the other embeddings tests pass

Changed files:
filename: llama/runner/runner.go
patch: @@ -59,7 +59,7 @@ func (s *Sequence) prompt() bool {
 }
 
 func (s *Server) NewSequence(prompt string, numPredict int, stop []string, params *llama.SamplingParams, embedding bool) *Sequence {
-	tokens, err := s.lc.Model().Tokenize(prompt, false, true)
+	tokens, err := s.lc.Model().Tokenize(prompt, embedding, true)
 	if err != nil {
 		panic(err)
 	}
@@ -345,11 +345,11 @@ func (s *Server) completion(w http.ResponseWriter, r *http.Request) {
 }
 
 type EmbeddingRequest struct {
-	Prompt string `json:"prompt"`
+	Content []string `json:"content"`
 }
 
 type EmbeddingResponse struct {
-	Embedding []float32 `json:"embedding"`
+	Embedding [][]float32 `json:"embedding"`
 }
 
 // TODO (jmorganca): is it safe to do this concurrently with decoding?
@@ -362,22 +362,37 @@ func (s *Server) embeddings(w http.ResponseWriter, r *http.Request) {
 
 	w.Header().Set("Content-Type", "application/json")
 
-	seq := s.NewSequence(req.Prompt, 0, nil, nil, true)
+	slog.Debug("embedding request", "content", req.Content)
+	seqs := make([]*Sequence, len(req.Content))
+	embeddings := make([][]float32, len(req.Content))
+	var processed int
+	for i, content := range req.Content {
+		seqs[i] = s.NewSequence(content, 0, nil, nil, true)
+	}
 
-	s.mu.Lock()
-	for i, sq := range s.seqs {
-		if sq == nil {
-			s.seqs[i] = seq
-			s.cond.Signal()
-			break
+	// TODO - refactor to go routines to add seq's and drain the responses
+	// so we don't stall until each set is iterated through
+	for processed < len(seqs) {
+		s.mu.Lock()
+		for i, sq := range s.seqs {
+			if processed >= len(seqs) {
+				break
+			}
+			if sq == nil {
+				s.seqs[i] = seqs[processed]
+				processed += 1
+			}
 		}
-	}
-	s.mu.Unlock()
+		s.cond.Signal()
+		s.mu.Unlock()
 
-	embedding := <-seq.embedding
+		for i := range processed {
+			embeddings[i] = <-seqs[i].embedding
+		}
+	}
 
 	if err := json.NewEncoder(w).Encode(&EmbeddingResponse{
-		Embedding: embedding,
+		Embedding: embeddings,
 	}); err != nil {
 		log.Println("Failed to encode result:", err)
 		return
Repository: nodejs/node
Pull request: deps: define V8_PRESERVE_MOST as no-op on Windows

When compiling with ClangCL, it's causing linker errors with node.lib in node-gyp and potentially breaks other 3rd party tools.

This was already reviewed in another PR where it was grouped with other changes. Here is the part of the description from that PR regarding this change:

_Disable V8_PRESERVE_MOST on Windows. We already have something similar for V8_NODISCARD as a floating patch, so it should not be a problem as I see it. If left, this results in functions that use it having `__swift_2` calling conventions rather than the expected `__cdecl`. This was noticed in `cppgc-object` native suites test. This change, if agreed upon, would be come one of our V8 floating patches we use on each V8 update._

Refs: https://github.com/nodejs/node/pull/55784

Changed files:
filename: common.gypi
patch: @@ -36,7 +36,7 @@
 
     # Reset this number to 0 on major V8 upgrades.
     # Increment by one for each non-official patch applied to deps/v8.
-    'v8_embedder_string': '-node.11',
+    'v8_embedder_string': '-node.12',
 
     ##### V8 defaults for Node.js #####
 

filename: deps/v8/include/v8config.h
patch: @@ -581,11 +581,15 @@ path. Add it with -I<path> to the command line
 // functions.
 // Use like:
 //   V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
+#if V8_OS_WIN
+# define V8_PRESERVE_MOST
+#else
 #if V8_HAS_ATTRIBUTE_PRESERVE_MOST
 # define V8_PRESERVE_MOST __attribute__((preserve_most))
 #else
 # define V8_PRESERVE_MOST /* NOT SUPPORTED */
 #endif
+#endif
 
 
 // A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
Repository: vuejs/vue
Pull request: fix multiple select render

fix the render of  multiple select with static template. The mutliple attribute of select dosen't apply at first, so the mutli selected option dosen't work when patching.  fix #3901 


Changed files:
filename: src/core/vdom/patch.js
patch: @@ -115,7 +115,7 @@ export function createPatchFunction (backend) {
       }
       vnode.elm = vnode.ns
         ? nodeOps.createElementNS(vnode.ns, tag)
-        : nodeOps.createElement(tag)
+        : nodeOps.createElement(tag, vnode)
       setScope(vnode)
       createChildren(vnode, children, insertedVnodeQueue)
       if (isDef(data)) {

filename: src/platforms/web/runtime/node-ops.js
patch: @@ -2,8 +2,15 @@
 
 import { namespaceMap } from 'web/util/index'
 
-export function createElement (tagName: string): Element {
-  return document.createElement(tagName)
+export function createElement (tagName: string, vnode: VNode): Element {
+  const elm = document.createElement(tagName)
+  if (tagName !== 'select') {
+    return elm
+  }
+  if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
+    elm.setAttribute('multiple', 'multiple')
+  }
+  return elm
 }
 
 export function createElementNS (namespace: string, tagName: string): Element {

filename: test/unit/features/directives/model-select.spec.js
patch: @@ -189,6 +189,21 @@ describe('Directive v-model select', () => {
     }).then(done)
   })
 
+  it('multiple with static template', () => {
+    const vm = new Vue({
+      template:
+      '<select multiple>' +
+        '<option selected>a</option>' +
+        '<option selected>b</option>' +
+        '<option selected>c</option>' +
+      '</select>'
+    }).$mount()
+    var opts = vm.$el.options
+    expect(opts[0].selected).toBe(true)
+    expect(opts[1].selected).toBe(true)
+    expect(opts[2].selected).toBe(true)
+  })
+
   it('multiple + v-for', done => {
     const vm = new Vue({
       data: {
Repository: ggml-org/llama.cpp
Pull request: common : clarify HTTPS build options in error message

This commit updates the https error message to provide clearer instructions for users who encounter the "HTTPS is not supported" error.

The motivation for this is that it might not be clear to users that only one of these options are needed to enable HTTPS support. The LLAMA_OPENSSL option is also added to the message to cover all possible build configurations.


Changed files:
filename: common/http.h
patch: @@ -60,10 +60,10 @@ static std::pair<httplib::Client, common_http_url> common_http_client(const std:
 #ifndef CPPHTTPLIB_OPENSSL_SUPPORT
     if (parts.scheme == "https") {
         throw std::runtime_error(
-            "HTTPS is not supported. Please rebuild with:\n"
+            "HTTPS is not supported. Please rebuild with one of:\n"
             "  -DLLAMA_BUILD_BORINGSSL=ON\n"
             "  -DLLAMA_BUILD_LIBRESSL=ON\n"
-            "or ensure dev files of an OpenSSL-compatible library are available when building."
+            "  -DLLAMA_OPENSSL=ON (default, requires OpenSSL dev files installed)"
         );
     }
 #endif
Repository: ollama/ollama
Pull request: fix modelfile message quotes

message commands should quote the content but it's not correctly formatted so it outputs content verbatim. fix the formatting will fix quoting

https://github.com/ollama/ollama/blob/main/parser/parser.go#L41-L43

resolves #6103

Changed files:
filename: server/images.go
patch: @@ -184,7 +184,7 @@ func (m *Model) String() string {
 	for _, msg := range m.Messages {
 		modelfile.Commands = append(modelfile.Commands, parser.Command{
 			Name: "message",
-			Args: fmt.Sprintf("%s %s", msg.Role, msg.Content),
+			Args: fmt.Sprintf("%s: %s", msg.Role, msg.Content),
 		})
 	}
Repository: nodejs/node
Pull request: tools: skip test-shared workflow for draft PRs

<!--
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: .github/workflows/test-shared.yml
patch: @@ -36,6 +36,7 @@ permissions:
 
 jobs:
   build:
+    if: github.event.pull_request.draft == false
     strategy:
       fail-fast: false
       matrix:
Repository: vuejs/vue
Pull request: add getTypeList to process mutli-type prop

the getType func only returns the first prop type, even if the prop type is an array.

Add getTypeList func to get prop types. 
fix #3879


Changed files:
filename: src/core/util/props.js
patch: @@ -21,7 +21,7 @@ export function validateProp (
   const absent = !hasOwn(propsData, key)
   let value = propsData[key]
   // handle boolean props
-  if (getType(prop.type) === 'Boolean') {
+  if (isBooleanType(prop.type)) {
     if (absent && !hasOwn(prop, 'default')) {
       value = false
     } else if (value === '' || value === hyphenate(key)) {
@@ -160,3 +160,17 @@ function getType (fn) {
   const match = fn && fn.toString().match(/^\s*function (\w+)/)
   return match && match[1]
 }
+
+function isBooleanType (fn) {
+  const isBoolean = (fnItem) => getType(fnItem) === 'Boolean'
+
+  if (!Array.isArray(fn)) {
+    return isBoolean(fn)
+  }
+  for (let i = 0, len = fn.length; i < len; i++) {
+    if (isBoolean(fn[i])) {
+      return true
+    }
+  }
+  return false
+}
Repository: huggingface/transformers
Pull request: Fix Mac mps dataloader_num_workers > 1 causes RuntimeError: _share_filename_: only available on CPU

# What does this PR do?

I have encountered an error during training on an M1 mac, similar to:
https://github.com/pytorch/pytorch/issues/87688

I have implemented the suggested fix, and it works.


## 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?

- trainer: @zach-huggingface, @SunMarc and @qgallouedec



Changed files:
filename: src/transformers/trainer.py
patch: @@ -1023,12 +1023,16 @@ def _get_dataloader(
         else:
             data_collator = self._get_collator_with_removed_columns(self.data_collator, description=description)
 
+        # MPS requrires forking if multiple workers are specified
+        should_fork = torch.backends.mps.is_available() and self.args.dataloader_num_workers > 1
+
         dataloader_params = {
             "batch_size": batch_size,
             "collate_fn": data_collator,
             "num_workers": self.args.dataloader_num_workers,
             "pin_memory": self.args.dataloader_pin_memory,
             "persistent_workers": self.args.dataloader_persistent_workers,
+            "multiprocessing_context": "fork" if should_fork else None,
         }
 
         if not isinstance(dataset, torch.utils.data.IterableDataset):
Repository: ollama/ollama
Pull request: patches: phi3 optional sliding window attention

this change allows models that do not set `phi3.attention.sliding_window` to revert to the previous behaviour instead of segfaulting

resolves #5956 

Changed files:
filename: llm/patches/11-phi3-sliding-window.diff
patch: @@ -0,0 +1,43 @@
+From 6eedae4cf2fcc8015dac79cb3f28f61fcabacab2 Mon Sep 17 00:00:00 2001
+From: Michael Yang <mxyng@pm.me>
+Date: Wed, 31 Jul 2024 14:57:04 -0700
+Subject: [PATCH] phi3 sliding window
+
+---
+ src/llama.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/llama.cpp b/src/llama.cpp
+index a207451f..f2872d4e 100644
+--- a/src/llama.cpp
++++ b/src/llama.cpp
+@@ -4893,7 +4893,7 @@ static void llm_load_hparams(
+             } break;
+         case LLM_ARCH_PHI3:
+             {
+-                ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa);
++                ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa, false);
+                 ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps);
+ 
+                 switch (hparams.n_layer) {
+@@ -10762,7 +10762,7 @@ struct llm_build_context {
+         struct ggml_tensor * inp_pos = build_inp_pos();
+ 
+         // KQ_mask (mask for 1 head, it will be broadcasted to all heads)
+-        struct ggml_tensor * KQ_mask_swa = build_inp_KQ_mask_swa();
++        struct ggml_tensor * KQ_mask = hparams.n_swa > 0 ? build_inp_KQ_mask_swa() : build_inp_KQ_mask();
+ 
+         for (int il = 0; il < n_layer; ++il) {
+             auto residual = inpL;
+@@ -10820,7 +10820,7 @@ struct llm_build_context {
+ 
+                 cur = llm_build_kv(ctx0, lctx, kv_self, gf,
+                         model.layers[il].wo, model.layers[il].bo,
+-                        Kcur, Vcur, Qcur, KQ_mask_swa, n_tokens, kv_head, n_kv, 1.0f, cb, il);
++                        Kcur, Vcur, Qcur, KQ_mask, n_tokens, kv_head, n_kv, 1.0f, cb, il);
+             }
+ 
+             if (il == n_layer - 1) {
+-- 
+2.45.2
+
Repository: vuejs/vue
Pull request: add license information to vue.common.js

The license information in `vue.common.js` is needed for compiling bundles with webpack.

Without the license, an app that does `require('vue')` and is compiled with webpack will not give proper attribution to the grat work done by Vue.


Changed files:
filename: build/config.js
patch: @@ -19,14 +19,16 @@ const builds = {
   'web-runtime-dev': {
     entry: path.resolve(__dirname, '../src/entries/web-runtime.js'),
     dest: path.resolve(__dirname, '../dist/vue.common.js'),
-    format: 'cjs'
+    format: 'cjs',
+    banner
   },
   // Minified runtime, only for filze size monitoring
   'web-runtime-prod': {
     entry: path.resolve(__dirname, '../src/entries/web-runtime.js'),
     dest: path.resolve(__dirname, '../dist/vue.common.min.js'),
     format: 'umd',
-    env: 'production'
+    env: 'production',
+    banner
   },
   // Runtime+compiler standalone developement build.
   'web-standalone-dev': {
Repository: nodejs/node
Pull request: tools: disable inspector on macOS-shared to reduce flakiness

Those are currently annoyingly flaky, and we don't seem to have a CI covering the `--without-inspector` flag (see https://github.com/nodejs/node/pull/60289), so this PR is one stone two birds

<!--
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: .github/workflows/test-shared.yml
patch: @@ -78,6 +78,7 @@ jobs:
             --arg ccache '(import <nixpkgs> {}).sccache' \
             --arg devTools '[]' \
             --arg benchmarkTools '[]' \
+            ${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-inspector"]'' \' || '\' }}
             --run '
                 make run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
             '
Repository: electron/electron
Pull request: ci: fix release branch name in build stats script

#### Description of Change

<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

Fast follow-up to #48509, as branch names aren't being populated for release branches. Unfortunately there's not one single environment variable which gives us the name we want (the short ref name) for both PRs and release branches. So first check the one that's good for PRs (and blank on release branches) and then fall back to the other.

| | PR | Release Branch |
|---|:---:|:---:|
| `GITHUB_HEAD_REF` | `<branch_name>` |  |
| `GITHUB_REF_NAME` | `<pr_number>/merge` | `main` |

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd

#### Release Notes

Notes: none <!-- 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 -->


Changed files:
filename: script/build-stats.mjs
patch: @@ -45,7 +45,13 @@ async function main () {
 
     if (process.env.TARGET_ARCH) tags.push(`target-arch:${process.env.TARGET_ARCH}`);
     if (process.env.TARGET_PLATFORM) tags.push(`target-platform:${process.env.TARGET_PLATFORM}`);
-    if (process.env.GITHUB_HEAD_REF) tags.push(`branch:${process.env.GITHUB_HEAD_REF}`);
+    if (process.env.GITHUB_HEAD_REF) {
+      // Will be set in pull requests
+      tags.push(`branch:${process.env.GITHUB_HEAD_REF}`);
+    } else if (process.env.GITHUB_REF_NAME) {
+      // Will be set for release branches
+      tags.push(`branch:${process.env.GITHUB_REF_NAME}`);
+    }
 
     const series = [
       {