helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: llama : fix build_ffn without gate

While porting these `build_*` function to `clip.cpp`, I came across the case of FFN **not** having gate (which is quite common in vision transformers)

The current logic in `llm_graph_context::build_ffn` kinda assumes that gate always exist (which make sense, since most - if not all - modern LLM have up/gate/down FFN). If the gate is missing, this causes the logic to calculate `cur = up_state * up_state` which results in an incorrect result.

I'm not sure if the code is intended to be written this way, but I think we should either:
- add `gate` to the check as proposed in this PR
- or, `GGML_ASSERT(gate)` to make sure the gate is always there

Please note that when porting to ViT, I only copy the case of `LLM_FFN_PAR` and not `LLM_FFN_SEQ`

Changed files:
filename: src/llama-graph.cpp
patch: @@ -782,7 +782,7 @@ ggml_tensor * llm_graph_context::build_ffn(
             } break;
     }
 
-    if (type_gate == LLM_FFN_PAR) {
+    if (gate && type_gate == LLM_FFN_PAR) {
         cur = ggml_mul(ctx0, cur, tmp);
         cb(cur, "ffn_gate_par", il);
     }
Repository: vercel/next.js
Pull request: Documentation: Removed reference to treeShaking in 08-turbopack.mdx

Removed reference to treeShaking, which isn't a known property in TurbopackOptions.

Changed files:
filename: docs/01-app/03-api-reference/08-turbopack.mdx
patch: @@ -132,8 +132,6 @@ Turbopack can be configured via `next.config.js` (or `next.config.ts`) under the
   Change or extend file extensions for module resolution.
 - **`moduleIds`**
   Set how module IDs are generated (`'named'` vs `'deterministic'`).
-- **`treeShaking`**
-  Enable or disable tree shaking in dev and future production builds.
 - **`memoryLimit`**
   Set a memory limit (in bytes) for Turbopack.
Repository: ollama/ollama
Pull request: Add wizard vicuna uncensored model link


Changed files:
filename: README.md
patch: @@ -54,12 +54,13 @@ Hello! It's your friend Mario.
 
 Ollama includes a library of open-source, pre-trained models. More models are coming soon.
 
-| Model       | Parameters | Size  | Download                  |
-| ----------- | ---------- | ----- | ------------------------- |
-| Llama2      | 7B         | 3.8GB | `ollama pull llama2`      |
-| Orca Mini   | 3B         | 1.9GB | `ollama pull orca`        |
-| Vicuna      | 7B         | 3.8GB | `ollama pull vicuna`      |
-| Nous-Hermes | 13B         | 7.3GB | `ollama pull nous-hermes` |
+| Model                     | Parameters | Size  | Download                    |
+| ----------------------    | ---------- | ----- | --------------------------- |
+| Llama2                    | 7B         | 3.8GB | `ollama pull llama2`        |
+| Orca Mini                 | 3B         | 1.9GB | `ollama pull orca`          |
+| Vicuna                    | 7B         | 3.8GB | `ollama pull vicuna`        |
+| Nous-Hermes               | 13B        | 7.3GB | `ollama pull nous-hermes`   |
+| Wizard Vicuna Uncensored  | 13B        | 6.8GB | `ollama pull wizard-vicuna` |
 
 ## Building
Repository: ollama/ollama
Pull request: add license layers to the parser


Changed files:
filename: parser/parser.go
patch: @@ -46,8 +46,8 @@ func Parse(reader io.Reader) ([]Command, error) {
 				return nil, fmt.Errorf("no model specified in FROM line")
 			}
 			foundModel = true
-		case "PROMPT":
-			command.Name = "prompt"
+		case "PROMPT", "LICENSE":
+			command.Name = strings.ToLower(fields[0])
 			if fields[1] == `"""` {
 				multiline = true
 				multilineCommand = &command

filename: server/images.go
patch: @@ -215,6 +215,16 @@ func CreateModel(name string, mf io.Reader, fn func(status string)) error {
 			}
 			l.MediaType = "application/vnd.ollama.image.prompt"
 			layers = append(layers, l)
+		case "license":
+			fn("creating license layer")
+			license := strings.NewReader(c.Arg)
+			l, err := CreateLayer(license)
+			if err != nil {
+				fn(fmt.Sprintf("couldn't create license layer: %v", err))
+				return fmt.Errorf("failed to create layer: %v", err)
+			}
+			l.MediaType = "application/vnd.ollama.image.license"
+			layers = append(layers, l)
 		default:
 			params[c.Name] = c.Arg
 		}
Repository: electron/electron
Pull request: perf: avoid redundant map lookup in `AddComponentResourceEntries()`

#### Description of Change

Another remove-redundant-map-lookups PR. This one fixes a double-lookup in `ElectronComponentExtensionResourceManager::AddComponentResourceEntries()`.

#### 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: none.

Changed files:
filename: shell/browser/extensions/electron_component_extension_resource_manager.cc
patch: @@ -84,21 +84,24 @@ void ElectronComponentExtensionResourceManager::AddComponentResourceEntries(
   gen_folder_path = gen_folder_path.NormalizePathSeparators();
 
   for (const auto& entry : entries) {
+    const int id = entry.id;
     base::FilePath resource_path = base::FilePath().AppendASCII(entry.path);
     resource_path = resource_path.NormalizePathSeparators();
 
     if (!gen_folder_path.IsParent(resource_path)) {
-      DCHECK(!path_to_resource_id_.contains(resource_path));
-      path_to_resource_id_[resource_path] = entry.id;
+      const auto [_, inserted] =
+          path_to_resource_id_.try_emplace(std::move(resource_path), id);
+      DCHECK(inserted);
     } else {
       // If the resource is a generated file, strip the generated folder's path,
       // so that it can be served from a normal URL (as if it were not
       // generated).
       base::FilePath effective_path =
           base::FilePath().AppendASCII(resource_path.AsUTF8Unsafe().substr(
               gen_folder_path.value().length()));
-      DCHECK(!path_to_resource_id_.contains(effective_path));
-      path_to_resource_id_[effective_path] = entry.id;
+      const auto [_, inserted] =
+          path_to_resource_id_.try_emplace(std::move(effective_path), id);
+      DCHECK(inserted);
     }
   }
 }
Repository: electron/electron
Pull request: perf: avoid `std::map` temporaries  in `WebContents::DevToolsRequestFileSystems()`

Backport of #46268

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -682,17 +682,6 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
   return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
 }
 
-std::map<std::string, std::string> GetAddedFileSystemPaths(
-    content::WebContents* web_contents) {
-  std::map<std::string, std::string> result;
-  for (auto it : GetAddedFileSystems(web_contents)) {
-    std::string type =
-        it.second.is_string() ? it.second.GetString() : std::string();
-    result[it.first] = type;
-  }
-  return result;
-}
-
 bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
                                const std::string_view file_system_path) {
   return GetAddedFileSystems(web_contents).contains(file_system_path);
@@ -4147,31 +4136,22 @@ void WebContents::DevToolsAppendToFile(const std::string& url,
 }
 
 void WebContents::DevToolsRequestFileSystems() {
-  auto file_system_paths = GetAddedFileSystemPaths(GetDevToolsWebContents());
-  if (file_system_paths.empty()) {
-    inspectable_web_contents_->CallClientFunction(
-        "DevToolsAPI", "fileSystemsLoaded", base::Value(base::Value::List()));
-    return;
-  }
+  const std::string empty_str;
+  content::WebContents* const dtwc = GetDevToolsWebContents();
+  const base::Value::Dict& added_paths = GetAddedFileSystems(dtwc);
 
-  std::vector<FileSystem> file_systems;
-  for (const auto& file_system_path : file_system_paths) {
-    base::FilePath path =
-        base::FilePath::FromUTF8Unsafe(file_system_path.first);
-    std::string file_system_id =
-        RegisterFileSystem(GetDevToolsWebContents(), path);
-    FileSystem file_system =
-        CreateFileSystemStruct(GetDevToolsWebContents(), file_system_id,
-                               file_system_path.first, file_system_path.second);
-    file_systems.push_back(file_system);
+  auto filesystems = base::Value::List::with_capacity(added_paths.size());
+  for (const auto path_and_type : added_paths) {
+    const auto& [path, type_val] = path_and_type;
+    const auto& type = type_val.is_string() ? type_val.GetString() : empty_str;
+    const std::string file_system_id =
+        RegisterFileSystem(dtwc, base::FilePath::FromUTF8Unsafe(path));
+    filesystems.Append(CreateFileSystemValue(
+        CreateFileSystemStruct(dtwc, file_system_id, path, type)));
   }
 
-  base::Value::List file_system_value;
-  for (const auto& file_system : file_systems)
-    file_system_value.Append(CreateFileSystemValue(file_system));
   inspectable_web_contents_->CallClientFunction(
-      "DevToolsAPI", "fileSystemsLoaded",
-      base::Value(std::move(file_system_value)));
+      "DevToolsAPI", "fileSystemsLoaded", base::Value{std::move(filesystems)});
 }
 
 void WebContents::DevToolsAddFileSystem(
Repository: ggml-org/llama.cpp
Pull request: chat : clarify the meaning of reasoning_format

Ref comment: https://github.com/ggml-org/llama.cpp/pull/15404#discussion_r2283476905

> The long story is that the `message.reasoning_content` API response format is initially introduced by deepseek hosted API, hence the name `deepseek`
> 
> This enum was added so in case openai wants to have their own API schema, then we can select between either `deepseek` or `openai`. However, the meaning is lost in time due to a combination of bad naming and poor documentation.
> 
> `auto` was added as a no-brainer solution since deepseek `reasoning_content` is now supported by many applications, while OAI migrated to their new Response API.
> 
> This `reasoning_format` solely determines the API schema, it is unrelated to the notion of parser or anything at chat template layer. Parser is determined by the chat template itself.

For this reason, `common_reasoning_format` should not be touched anymore.


Changed files:
filename: common/chat.cpp
patch: @@ -632,7 +632,6 @@ const char * common_reasoning_format_name(common_reasoning_format format) {
         case COMMON_REASONING_FORMAT_AUTO:     return "auto";
         case COMMON_REASONING_FORMAT_DEEPSEEK: return "deepseek";
         case COMMON_REASONING_FORMAT_DEEPSEEK_LEGACY: return "deepseek-legacy";
-        case COMMON_REASONING_FORMAT_GRANITE: return "granite";
         default:
             throw std::runtime_error("Unknown reasoning format");
     }

filename: common/common.h
patch: @@ -239,12 +239,15 @@ struct common_params_diffusion {
     bool    add_gumbel_noise = false; // add gumbel noise to the logits if temp > 0.0
 };
 
+// reasoning API response format (not to be confused as chat template's reasoning format)
 enum common_reasoning_format {
     COMMON_REASONING_FORMAT_NONE,
-    COMMON_REASONING_FORMAT_AUTO,
+    COMMON_REASONING_FORMAT_AUTO,            // Same as deepseek, using `message.reasoning_content`
     COMMON_REASONING_FORMAT_DEEPSEEK_LEGACY, // Extract thinking tag contents and return as `message.reasoning_content`, or leave inline in <think> tags in stream mode
     COMMON_REASONING_FORMAT_DEEPSEEK,        // Extract thinking tag contents and return as `message.reasoning_content`, including in streaming deltas.
-    COMMON_REASONING_FORMAT_GRANITE,         // Extract thinking tag contents and return as `message.reasoning_content`, including in streaming deltas.
+    // do not extend this enum unless you absolutely have to
+    // in most cases, use COMMON_REASONING_FORMAT_AUTO
+    // see: https://github.com/ggml-org/llama.cpp/pull/15408
 };
 
 

filename: tests/test-chat.cpp
patch: @@ -1408,7 +1408,7 @@ static void test_template_output_parsers() {
                 /* is_partial= */ false,
                 {
                     /* .format = */ COMMON_CHAT_FORMAT_GRANITE,
-                    /* .reasoning_format = */ COMMON_REASONING_FORMAT_GRANITE,
+                    /* .reasoning_format = */ COMMON_REASONING_FORMAT_DEEPSEEK,
                 }));
 
         // Test parsing tool calls
Repository: electron/electron
Pull request: perf: avoid `std::map` temporaries  in `WebContents::DevToolsRequestFileSystems()`

Backport of #46268

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -682,17 +682,6 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
   return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
 }
 
-std::map<std::string, std::string> GetAddedFileSystemPaths(
-    content::WebContents* web_contents) {
-  std::map<std::string, std::string> result;
-  for (auto it : GetAddedFileSystems(web_contents)) {
-    std::string type =
-        it.second.is_string() ? it.second.GetString() : std::string();
-    result[it.first] = type;
-  }
-  return result;
-}
-
 bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
                                const std::string_view file_system_path) {
   return GetAddedFileSystems(web_contents).contains(file_system_path);
@@ -4053,31 +4042,22 @@ void WebContents::DevToolsAppendToFile(const std::string& url,
 }
 
 void WebContents::DevToolsRequestFileSystems() {
-  auto file_system_paths = GetAddedFileSystemPaths(GetDevToolsWebContents());
-  if (file_system_paths.empty()) {
-    inspectable_web_contents_->CallClientFunction(
-        "DevToolsAPI", "fileSystemsLoaded", base::Value(base::Value::List()));
-    return;
-  }
+  const std::string empty_str;
+  content::WebContents* const dtwc = GetDevToolsWebContents();
+  const base::Value::Dict& added_paths = GetAddedFileSystems(dtwc);
 
-  std::vector<FileSystem> file_systems;
-  for (const auto& file_system_path : file_system_paths) {
-    base::FilePath path =
-        base::FilePath::FromUTF8Unsafe(file_system_path.first);
-    std::string file_system_id =
-        RegisterFileSystem(GetDevToolsWebContents(), path);
-    FileSystem file_system =
-        CreateFileSystemStruct(GetDevToolsWebContents(), file_system_id,
-                               file_system_path.first, file_system_path.second);
-    file_systems.push_back(file_system);
+  auto filesystems = base::Value::List::with_capacity(added_paths.size());
+  for (const auto path_and_type : added_paths) {
+    const auto& [path, type_val] = path_and_type;
+    const auto& type = type_val.is_string() ? type_val.GetString() : empty_str;
+    const std::string file_system_id =
+        RegisterFileSystem(dtwc, base::FilePath::FromUTF8Unsafe(path));
+    filesystems.Append(CreateFileSystemValue(
+        CreateFileSystemStruct(dtwc, file_system_id, path, type)));
   }
 
-  base::Value::List file_system_value;
-  for (const auto& file_system : file_systems)
-    file_system_value.Append(CreateFileSystemValue(file_system));
   inspectable_web_contents_->CallClientFunction(
-      "DevToolsAPI", "fileSystemsLoaded",
-      base::Value(std::move(file_system_value)));
+      "DevToolsAPI", "fileSystemsLoaded", base::Value{std::move(filesystems)});
 }
 
 void WebContents::DevToolsAddFileSystem(
Repository: ggml-org/llama.cpp
Pull request: chat : hotfix gpt-oss jinja raising an exception

Ref: https://github.com/ggml-org/llama.cpp/pull/15230#issuecomment-3174697922

Tested and confirm to work with unsloth GGUF: https://huggingface.co/unsloth/gpt-oss-20b-GGUF?chat_template=default


Changed files:
filename: common/chat.cpp
patch: @@ -552,6 +552,17 @@ common_chat_templates_ptr common_chat_templates_init(
             default_template_src = CHATML_TEMPLATE_SRC;
         }
     }
+
+    // TODO @ngxson : this is a temporary hack to prevent chat template from throwing an error
+    // Ref: https://github.com/ggml-org/llama.cpp/pull/15230#issuecomment-3173959633
+    if (default_template_src.find("
") != std::string::npos
+            // search for the error message and patch it
+            && default_template_src.find("in message.content or") != std::string::npos) {
+        string_replace_all(default_template_src,
+            "{%- if \"
analysis
\" in message.content or \"
final
\" in message.content %}",
+            "{%- if false %}");
+    }
+
     std::string token_bos = bos_token_override;
     std::string token_eos = eos_token_override;
     bool add_bos = false;
Repository: electron/electron
Pull request: perf: avoid `std::map` temporaries  in `WebContents::DevToolsRequestFileSystems()`

Backport of #46268

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -680,17 +680,6 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
   return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
 }
 
-std::map<std::string, std::string> GetAddedFileSystemPaths(
-    content::WebContents* web_contents) {
-  std::map<std::string, std::string> result;
-  for (auto it : GetAddedFileSystems(web_contents)) {
-    std::string type =
-        it.second.is_string() ? it.second.GetString() : std::string();
-    result[it.first] = type;
-  }
-  return result;
-}
-
 bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
                                const std::string_view file_system_path) {
   return GetAddedFileSystems(web_contents).contains(file_system_path);
@@ -4173,31 +4162,22 @@ void WebContents::DevToolsAppendToFile(const std::string& url,
 }
 
 void WebContents::DevToolsRequestFileSystems() {
-  auto file_system_paths = GetAddedFileSystemPaths(GetDevToolsWebContents());
-  if (file_system_paths.empty()) {
-    inspectable_web_contents_->CallClientFunction(
-        "DevToolsAPI", "fileSystemsLoaded", base::Value(base::Value::List()));
-    return;
-  }
+  const std::string empty_str;
+  content::WebContents* const dtwc = GetDevToolsWebContents();
+  const base::Value::Dict& added_paths = GetAddedFileSystems(dtwc);
 
-  std::vector<FileSystem> file_systems;
-  for (const auto& file_system_path : file_system_paths) {
-    base::FilePath path =
-        base::FilePath::FromUTF8Unsafe(file_system_path.first);
-    std::string file_system_id =
-        RegisterFileSystem(GetDevToolsWebContents(), path);
-    FileSystem file_system =
-        CreateFileSystemStruct(GetDevToolsWebContents(), file_system_id,
-                               file_system_path.first, file_system_path.second);
-    file_systems.push_back(file_system);
+  auto filesystems = base::Value::List::with_capacity(added_paths.size());
+  for (const auto path_and_type : added_paths) {
+    const auto& [path, type_val] = path_and_type;
+    const auto& type = type_val.is_string() ? type_val.GetString() : empty_str;
+    const std::string file_system_id =
+        RegisterFileSystem(dtwc, base::FilePath::FromUTF8Unsafe(path));
+    filesystems.Append(CreateFileSystemValue(
+        CreateFileSystemStruct(dtwc, file_system_id, path, type)));
   }
 
-  base::Value::List file_system_value;
-  for (const auto& file_system : file_systems)
-    file_system_value.Append(CreateFileSystemValue(file_system));
   inspectable_web_contents_->CallClientFunction(
-      "DevToolsAPI", "fileSystemsLoaded",
-      base::Value(std::move(file_system_value)));
+      "DevToolsAPI", "fileSystemsLoaded", base::Value{std::move(filesystems)});
 }
 
 void WebContents::DevToolsAddFileSystem(
Repository: ollama/ollama
Pull request: resolve modelfile before passing to server


Changed files:
filename: cmd/cmd.go
patch: @@ -9,6 +9,7 @@ import (
 	"net"
 	"net/http"
 	"os"
+	"path/filepath"
 	"strings"
 	"time"
 
@@ -25,6 +26,11 @@ import (
 
 func create(cmd *cobra.Command, args []string) error {
 	filename, _ := cmd.Flags().GetString("file")
+	filename, err := filepath.Abs(filename)
+	if err != nil {
+		return err
+	}
+
 	client := api.NewClient()
 
 	var spinner *Spinner
Repository: electron/electron
Pull request: fix: set `userAgent` on `navigationHistory.restore()`

Backport of #46260

See that PR for details.


Notes: Fixed an issue where `navigationHistory.restore()` failed to restore the `userAgent` if it was overridden.

Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -2624,6 +2624,9 @@ void WebContents::RestoreHistory(
   auto navigation_entries = std::make_unique<
       std::vector<std::unique_ptr<content::NavigationEntry>>>();
 
+  blink::UserAgentOverride ua_override;
+  ua_override.ua_string_override = GetUserAgent();
+
   for (const auto& entry : entries) {
     content::NavigationEntry* nav_entry = nullptr;
     if (!gin::Converter<content::NavigationEntry*>::FromV8(isolate, entry,
@@ -2636,11 +2639,15 @@ void WebContents::RestoreHistory(
           std::to_string(index) + ".");
       return;
     }
+
+    nav_entry->SetIsOverridingUserAgent(
+        !ua_override.ua_string_override.empty());
     navigation_entries->push_back(
         std::unique_ptr<content::NavigationEntry>(nav_entry));
   }
 
   if (!navigation_entries->empty()) {
+    web_contents()->SetUserAgentOverride(ua_override, false);
     web_contents()->GetController().Restore(
         index, content::RestoreType::kRestored, navigation_entries.get());
     web_contents()->GetController().LoadIfNecessary();

filename: spec/api-web-contents-spec.ts
patch: @@ -887,6 +887,31 @@ describe('webContents module', () => {
         });
       });
     });
+
+    it('should restore an overridden user agent', async () => {
+      const partition = 'persist:wcvtest';
+      const testUA = 'MyCustomUA';
+
+      const ses = session.fromPartition(partition);
+      ses.setUserAgent(testUA);
+
+      const wcv = new WebContentsView({
+        webPreferences: { partition }
+      });
+
+      wcv.webContents.navigationHistory.restore({
+        entries: [{
+          url: urlPage1,
+          title: 'url1'
+        }],
+        index: 0
+      });
+
+      const ua = wcv.webContents.getUserAgent();
+      const wcvua = await wcv.webContents.executeJavaScript('navigator.userAgent');
+
+      expect(ua).to.equal(wcvua);
+    });
   });
 
   describe('getFocusedWebContents() API', () => {