helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: perf: avoid `std::map` temporaries in `IsDevToolsFileSystemAdded()`

Backport of #46230

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -676,13 +676,16 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
   return static_cast<electron::ElectronBrowserContext*>(context)->prefs();
 }
 
+// returns a Dict of filesystem_path -> type
+[[nodiscard]] const base::Value::Dict& GetAddedFileSystems(
+    content::WebContents* web_contents) {
+  return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
+}
+
 std::map<std::string, std::string> GetAddedFileSystemPaths(
     content::WebContents* web_contents) {
-  auto* pref_service = GetPrefService(web_contents);
-  const base::Value::Dict& file_system_paths =
-      pref_service->GetDict(prefs::kDevToolsFileSystemPaths);
   std::map<std::string, std::string> result;
-  for (auto it : file_system_paths) {
+  for (auto it : GetAddedFileSystems(web_contents)) {
     std::string type =
         it.second.is_string() ? it.second.GetString() : std::string();
     result[it.first] = type;
@@ -691,8 +694,8 @@ std::map<std::string, std::string> GetAddedFileSystemPaths(
 }
 
 bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
-                               const std::string& file_system_path) {
-  return GetAddedFileSystemPaths(web_contents).contains(file_system_path);
+                               const std::string_view file_system_path) {
+  return GetAddedFileSystems(web_contents).contains(file_system_path);
 }
 
 content::RenderFrameHost* GetRenderFrameHost(
Repository: huggingface/transformers
Pull request: [Idefics] fix device mismatch

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/39947. We need to use consistent device when computing `position_ids`, and since we are updating `position_ids` we will use its device instead of `pixel_values`. Otherwise it raises errors because those are located in two different devices

Changed files:
filename: src/transformers/models/idefics2/modeling_idefics2.py
patch: @@ -147,8 +147,8 @@ def forward(self, pixel_values: torch.FloatTensor, patch_attention_mask: torch.B
             nb_patches_h = p_attn_mask[:, 0].sum()
             nb_patches_w = p_attn_mask[0].sum()
 
-            h_indices = torch.arange(nb_patches_h, device=pixel_values.device, dtype=pixel_values.dtype)
-            w_indices = torch.arange(nb_patches_w, device=pixel_values.device, dtype=pixel_values.dtype)
+            h_indices = torch.arange(nb_patches_h, device=position_ids.device, dtype=position_ids.dtype)
+            w_indices = torch.arange(nb_patches_w, device=position_ids.device, dtype=position_ids.dtype)
 
             fractional_coords_h = h_indices / nb_patches_h * (1 - 1e-6)
             fractional_coords_w = w_indices / nb_patches_w * (1 - 1e-6)

filename: src/transformers/models/idefics3/modeling_idefics3.py
patch: @@ -147,8 +147,8 @@ def forward(self, pixel_values: torch.FloatTensor, patch_attention_mask: torch.B
             nb_patches_h = p_attn_mask[:, 0].sum()
             nb_patches_w = p_attn_mask[0].sum()
 
-            h_indices = torch.arange(nb_patches_h, device=pixel_values.device, dtype=pixel_values.dtype)
-            w_indices = torch.arange(nb_patches_w, device=pixel_values.device, dtype=pixel_values.dtype)
+            h_indices = torch.arange(nb_patches_h, device=position_ids.device, dtype=position_ids.dtype)
+            w_indices = torch.arange(nb_patches_w, device=position_ids.device, dtype=position_ids.dtype)
 
             fractional_coords_h = h_indices / nb_patches_h * (1 - 1e-6)
             fractional_coords_w = w_indices / nb_patches_w * (1 - 1e-6)

filename: src/transformers/models/smolvlm/modeling_smolvlm.py
patch: @@ -142,8 +142,8 @@ def forward(self, pixel_values: torch.FloatTensor, patch_attention_mask: torch.B
             nb_patches_h = p_attn_mask[:, 0].sum()
             nb_patches_w = p_attn_mask[0].sum()
 
-            h_indices = torch.arange(nb_patches_h, device=pixel_values.device, dtype=pixel_values.dtype)
-            w_indices = torch.arange(nb_patches_w, device=pixel_values.device, dtype=pixel_values.dtype)
+            h_indices = torch.arange(nb_patches_h, device=position_ids.device, dtype=position_ids.dtype)
+            w_indices = torch.arange(nb_patches_w, device=position_ids.device, dtype=position_ids.dtype)
 
             fractional_coords_h = h_indices / nb_patches_h * (1 - 1e-6)
             fractional_coords_w = w_indices / nb_patches_w * (1 - 1e-6)
Repository: ggml-org/llama.cpp
Pull request: ci : attempt to fix ubuntu-latest-cmake-rpc

Not sure what's going on with the `(ILLEGAL)` failures here, but likely due to ccache (see #16355), try disabling it.

Changed files:
filename: .github/workflows/build.yml
patch: @@ -362,11 +362,11 @@ jobs:
         id: checkout
         uses: actions/checkout@v4
 
-      - name: ccache
-        uses: ggml-org/ccache-action@v1.2.16
-        with:
-          key: ubuntu-latest-cmake-rpc
-          evict-old-files: 1d
+      # - name: ccache
+      #   uses: ggml-org/ccache-action@v1.2.16
+      #   with:
+      #     key: ubuntu-latest-cmake-rpc
+      #     evict-old-files: 1d
 
       - name: Dependencies
         id: depends
Repository: ollama/ollama
Pull request: embed templates


Changed files:
filename: server/routes.go
patch: @@ -1,6 +1,7 @@
 package server
 
 import (
+	"embed"
 	"encoding/json"
 	"fmt"
 	"io"
@@ -19,7 +20,9 @@ import (
 	"github.com/jmorganca/ollama/llama"
 )
 
-var templates = template.Must(template.ParseGlob("templates/*.prompt"))
+//go:embed templates/*
+var templatesFS embed.FS
+var templates = template.Must(template.ParseFS(templatesFS, "templates/*.prompt"))
 
 func generate(c *gin.Context) {
 	// TODO: these should be request parameters
Repository: denoland/deno
Pull request: fix(fmt/css): prefer collapsing font-family values

Closes https://github.com/denoland/deno/issues/29336

Changed files:
filename: Cargo.lock
patch: @@ -5534,9 +5534,9 @@ dependencies = [
 
 [[package]]
 name = "malva"
-version = "0.11.2"
+version = "0.12.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a952f521471c6c8302a17fc0c64a512221a9d4ff268af4d43a02bc2be48c712"
+checksum = "aa8f6005fe3f2348f1fc59d647ee6945d5832fd080178e6d034bab1bf7976348"
 dependencies = [
  "aho-corasick",
  "itertools 0.14.0",

filename: Cargo.toml
patch: @@ -307,7 +307,7 @@ dprint-plugin-typescript = "=0.95.8"
 env_logger = "=0.11.6"
 fancy-regex = "=0.14.0"
 libsui = "0.10.0"
-malva = "=0.11.2"
+malva = "=0.12.1"
 markup_fmt = "=0.22.0"
 open = "5.0.1"
 pathdiff = "0.2.1"

filename: cli/tools/fmt.rs
patch: @@ -616,6 +616,8 @@ fn format_embedded_css(
       selector_override_comment_directive: "malva-selector-override".into(),
       ignore_comment_directive: "malva-ignore".into(),
       ignore_file_comment_directive: "malva-ignore-file".into(),
+      declaration_order_group_by:
+        config::DeclarationOrderGroupBy::NonDeclaration,
     },
   };
   // Wraps the text in a css block of `a { ... ;}`
@@ -1483,6 +1485,7 @@ fn get_resolved_malva_config(
     selector_override_comment_directive: "deno-fmt-selector-override".into(),
     ignore_comment_directive: "deno-fmt-ignore".into(),
     ignore_file_comment_directive: "deno-fmt-ignore-file".into(),
+    declaration_order_group_by: DeclarationOrderGroupBy::NonDeclaration,
   };
 
   FormatOptions {
Repository: ollama/ollama
Pull request: enable metal gpu acceleration

ggml-metal.metal must be in the same directory as the ollama binary otherwise llama.cpp will not be able to find it and load it.

1. go generate llama/llama_metal.go
2. go build .
3. ./ollama serve

Changed files:
filename: llama/CMakeLists.txt
patch: @@ -1,4 +1,6 @@
-cmake_minimum_required(VERSION 3.10) 
+cmake_minimum_required(VERSION 3.12)
+project(binding)
+
 include(FetchContent)
 
 FetchContent_Declare(
@@ -9,20 +11,13 @@ FetchContent_Declare(
 
 FetchContent_MakeAvailable(llama_cpp)
 
-if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-    set(LLAMA_METAL ON)
-    add_compile_definitions(GGML_USE_METAL)
-endif()
-
-project(binding)
-
 add_library(binding ${CMAKE_CURRENT_SOURCE_DIR}/binding/binding.cpp ${llama_cpp_SOURCE_DIR}/examples/common.cpp)
-target_compile_features(binding PRIVATE cxx_std_11)
-target_include_directories(binding PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
-target_include_directories(binding PRIVATE ${llama_cpp_SOURCE_DIR})
 target_include_directories(binding PRIVATE ${llama_cpp_SOURCE_DIR}/examples)
 target_link_libraries(binding llama ggml_static)
 
-configure_file(${llama_cpp_SOURCE_DIR}/ggml-metal.metal ${CMAKE_CURRENT_BINARY_DIR}/ggml-metal.metal COPYONLY)
-add_custom_target(copy_libllama ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${llama_cpp_BINARY_DIR}/libllama.a ${CMAKE_CURRENT_BINARY_DIR})
-add_custom_target(copy_libggml_static ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${llama_cpp_BINARY_DIR}/libggml_static.a ${CMAKE_CURRENT_BINARY_DIR})
\ No newline at end of file
+if (LLAMA_METAL)
+    configure_file(${llama_cpp_SOURCE_DIR}/ggml-metal.metal ${CMAKE_CURRENT_BINARY_DIR}/../../ggml-metal.metal COPYONLY)
+endif()
+
+add_custom_target(copy_libllama ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:llama> ${CMAKE_CURRENT_BINARY_DIR})
+add_custom_target(copy_libggml_static ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:ggml_static> ${CMAKE_CURRENT_BINARY_DIR})

filename: llama/llama_metal.go
patch: @@ -0,0 +1,5 @@
+//go:build metal
+package llama
+
+//go:generate cmake -S . -B build --fresh -DLLAMA_METAL=on
+//go:generate cmake --build build

filename: server/routes.go
patch: @@ -22,7 +22,7 @@ func pull(c *gin.Context) {
 
 func generate(c *gin.Context) {
 	// TODO: these should be request parameters
-	gpulayers := 0
+	gpulayers := 1
 	tokens := 512
 	threads := runtime.NumCPU()
 	// TODO: set prompt from template
Repository: ollama/ollama
Pull request: free llama model


Changed files:
filename: server/routes.go
patch: @@ -33,11 +33,12 @@ func generate(c *gin.Context) {
 		return
 	}
 
-	l, err := llama.New(req.Model, llama.EnableF16Memory, llama.SetContext(128), llama.EnableEmbeddings, llama.SetGPULayers(gpulayers))
+	model, err := llama.New(req.Model, llama.EnableF16Memory, llama.SetContext(128), llama.EnableEmbeddings, llama.SetGPULayers(gpulayers))
 	if err != nil {
 		fmt.Println("Loading the model failed:", err.Error())
 		return
 	}
+	defer model.Free()
 
 	templateNames := make([]string, 0, len(templates.Templates()))
 	for _, template := range templates.Templates() {
@@ -59,7 +60,7 @@ func generate(c *gin.Context) {
 
 	go func() {
 		defer close(ch)
-		_, err := l.Predict(req.Prompt, llama.Debug, llama.SetTokenCallback(func(token string) bool {
+		_, err := model.Predict(req.Prompt, llama.Debug, llama.SetTokenCallback(func(token string) bool {
 			ch <- token
 			return true
 		}), llama.SetTokens(tokens), llama.SetThreads(threads), llama.SetTopK(90), llama.SetTopP(0.86), llama.SetStopWords("llama"))
Repository: ollama/ollama
Pull request: tcp socket


Changed files:
filename: api/client.go
patch: @@ -11,12 +11,8 @@ import (
 )
 
 type Client struct {
-	Name       string
-	Version    string
 	URL        string
 	HTTP       http.Client
-	Headers    http.Header
-	PrivateKey []byte
 }
 
 func checkError(resp *http.Response, body []byte) error {
@@ -26,8 +22,7 @@ func checkError(resp *http.Response, body []byte) error {
 
 	apiError := Error{Code: int32(resp.StatusCode)}
 
-	err := json.Unmarshal(body, &apiError)
-	if err != nil {
+	if err := json.Unmarshal(body, &apiError); err != nil {
 		// Use the full body as the message if we fail to decode a response.
 		apiError.Message = string(body)
 	}
@@ -57,10 +52,6 @@ func (c *Client) stream(ctx context.Context, method string, path string, reqData
 	req.Header.Set("Content-Type", "application/json")
 	req.Header.Set("Accept", "application/json")
 
-	for k, v := range c.Headers {
-		req.Header[k] = v
-	}
-
 	res, err := c.HTTP.Do(req)
 	if err != nil {
 		return err
@@ -103,10 +94,6 @@ func (c *Client) do(ctx context.Context, method string, path string, reqData any
 	req.Header.Set("Content-Type", "application/json")
 	req.Header.Set("Accept", "application/json")
 
-	for k, v := range c.Headers {
-		req.Header[k] = v
-	}
-
 	respObj, err := c.HTTP.Do(req)
 	if err != nil {
 		return err

filename: cmd/cmd.go
patch: @@ -5,10 +5,8 @@ import (
 	"fmt"
 	"log"
 	"net"
-	"net/http"
 	"os"
 	"path"
-	"time"
 
 	"github.com/jmorganca/ollama/api"
 	"github.com/jmorganca/ollama/server"
@@ -40,47 +38,17 @@ func run(model string) error {
 }
 
 func serve() error {
-	sp := path.Join(cacheDir(), "ollama.sock")
-
-	if err := os.RemoveAll(sp); err != nil {
-		return err
-	}
-
-	ln, err := net.Listen("unix", sp)
+	ln, err := net.Listen("tcp", "127.0.0.1:11434")
 	if err != nil {
 		return err
 	}
 
-	if err := os.Chmod(sp, 0o700); err != nil {
-		return err
-	}
-
 	return server.Serve(ln)
 }
 
 func NewAPIClient() (*api.Client, error) {
-	var err error
-
-	home, err := os.UserHomeDir()
-	if err != nil {
-		return nil, err
-	}
-
-	socket := path.Join(home, ".ollama", "ollama.sock")
-
-	dialer := &net.Dialer{
-		Timeout: 10 * time.Second,
-	}
-
 	return &api.Client{
-		URL: "http://localhost",
-		HTTP: http.Client{
-			Transport: &http.Transport{
-				DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
-					return dialer.DialContext(ctx, "unix", socket)
-				},
-			},
-		},
+		URL: "http://localhost:11434",
 	}, nil
 }
Repository: huggingface/transformers
Pull request: Fix consistency

# What does this PR do?

cc @qubvel for viz after your PR!

Changed files:
filename: src/transformers/models/gpt_oss/modeling_gpt_oss.py
patch: @@ -160,6 +160,8 @@ def forward(self, hidden_states):
 
 
 class GptOssRotaryEmbedding(nn.Module):
+    inv_freq: torch.Tensor  # fix linting for `register_buffer`
+
     def __init__(self, config: GptOssConfig, device=None):
         super().__init__()
         # BC: "rope_type" was originally "type"
@@ -348,7 +350,7 @@ def forward(
         cache_position: Optional[torch.LongTensor] = None,
         position_embeddings: Optional[tuple[torch.Tensor, torch.Tensor]] = None,  # necessary, but kept here for BC
         **kwargs: Unpack[TransformersKwargs],
-    ) -> tuple[torch.Tensor]:
+    ) -> torch.Tensor:
         residual = hidden_states
         hidden_states = self.input_layernorm(hidden_states)
         # Self Attention

filename: src/transformers/models/gpt_oss/modular_gpt_oss.py
patch: @@ -307,7 +307,7 @@ def forward(
         cache_position: Optional[torch.LongTensor] = None,
         position_embeddings: Optional[tuple[torch.Tensor, torch.Tensor]] = None,  # necessary, but kept here for BC
         **kwargs: Unpack[TransformersKwargs],
-    ) -> tuple[torch.Tensor]:
+    ) -> torch.Tensor:
         residual = hidden_states
         hidden_states = self.input_layernorm(hidden_states)
         # Self Attention
Repository: ggml-org/llama.cpp
Pull request: ci : fix clean-up of old logs

The `rm` commands never worked because of the extra quotes, so the `README.md` file kept growing forever.

Changed files:
filename: ci/run.sh
patch: @@ -34,9 +34,9 @@ mkdir -p "$2"
 OUT=$(realpath "$1")
 MNT=$(realpath "$2")
 
-rm -f "$OUT/*.log"
-rm -f "$OUT/*.exit"
-rm -f "$OUT/*.md"
+rm -f $OUT/*.log
+rm -f $OUT/*.exit
+rm -f $OUT/*.md
 
 sd=`dirname $0`
 cd $sd/../
@@ -607,6 +607,7 @@ if [ -z ${GG_BUILD_LOW_PERF} ]; then
 fi
 
 ret=0
+
 test $ret -eq 0 && gg_run ctest_debug
 test $ret -eq 0 && gg_run ctest_release
 
@@ -624,4 +625,6 @@ if [ -z ${GG_BUILD_LOW_PERF} ]; then
     test $ret -eq 0 && gg_run ctest_with_model_release
 fi
 
+cat $OUT/README.md
+
 exit $ret
Repository: ollama/ollama
Pull request: Pull model name


Changed files:
filename: ollama/cmd/cli.py
patch: @@ -151,7 +151,7 @@ def pull(*args, **kwargs):
 
 
 def run(*args, **kwargs):
-    name = model.pull(*args, **kwargs)
+    name = model.pull(model_name=kwargs.pop('model'), *args, **kwargs)
     kwargs.update({"model": name})
     print(f"Running {name}...")
     generate(*args, **kwargs)

filename: ollama/engine.py
patch: @@ -30,7 +30,7 @@ def load(model_name, models={}):
     if not models.get(model_name, None):
         model_path = path.expanduser(model_name)
         if not path.exists(model_path):
-            model_path = path.join(MODELS_CACHE_PATH, model_name + ".bin")
+            model_path = MODELS_CACHE_PATH / model_name + ".bin"
 
         runners = {
             model_type: cls

filename: ollama/model.py
patch: @@ -7,7 +7,7 @@
 
 
 MODELS_MANIFEST = 'https://ollama.ai/api/models'
-MODELS_CACHE_PATH = path.join(Path.home(), '.ollama', 'models')
+MODELS_CACHE_PATH = Path.home() / '.ollama' / 'models'
 
 
 def models(*args, **kwargs):
@@ -78,7 +78,7 @@ def find_bin_file(json_response, location, branch):
 
 
 def download_file(download_url, file_name, file_size):
-    local_filename = path.join(MODELS_CACHE_PATH, file_name) + '.bin'
+    local_filename = MODELS_CACHE_PATH / file_name + '.bin'
 
     first_byte = path.getsize(local_filename) if path.exists(local_filename) else 0
 
@@ -110,25 +110,25 @@ def download_file(download_url, file_name, file_size):
     return local_filename
 
 
-def pull(model, *args, **kwargs):
-    if path.exists(model):
+def pull(model_name, *args, **kwargs):
+    if path.exists(model_name):
         # a file on the filesystem is being specified
-        return model
+        return model_name
     # check the remote model location and see if it needs to be downloaded
-    url = model
+    url = model_name
     file_name = ""
     if not validators.url(url) and not url.startswith('huggingface.co'):
-        url = get_url_from_directory(model)
-        file_name = model
+        url = get_url_from_directory(model_name)
+        file_name = model_name
 
     if not (url.startswith('http://') or url.startswith('https://')):
         url = f'https://{url}'
 
     if not validators.url(url):
-        if model in models(MODELS_CACHE_PATH):
+        if model_name in models(MODELS_CACHE_PATH):
             # the model is already downloaded, and specified by name
-            return model
-        raise Exception(f'Unknown model {model}')
+            return model_name
+        raise Exception(f'Unknown model {model_name}')
 
     local_filename = download_from_repo(url, file_name)
Repository: ollama/ollama
Pull request: use difflib.get_close_matches

same result with less code

Changed files:
filename: ollama/prompt.py
patch: @@ -1,19 +1,9 @@
-from os import path
-from difflib import SequenceMatcher
+from difflib import get_close_matches
 from jinja2 import Environment, PackageLoader
 
 
 def template(name, prompt):
-    best_ratio = 0
-    best_template = ''
-
     environment = Environment(loader=PackageLoader(__name__, 'templates'))
-    for template in environment.list_templates():
-        base, _ = path.splitext(template)
-        ratio = SequenceMatcher(None, path.basename(name).lower(), base).ratio()
-        if ratio > best_ratio:
-            best_ratio = ratio
-            best_template = template
-
-    template = environment.get_template(best_template)
+    best_templates = get_close_matches(name, environment.list_templates(), n=1, cutoff=0)
+    template = environment.get_template(best_templates.pop())
     return template.render(prompt=prompt)
Repository: denoland/deno
Pull request: test: fix specs::coverage::data_url test


Changed files:
filename: tests/specs/coverage/data_url/main.out
patch: @@ -4,12 +4,9 @@ test ... ok ([WILDLINE])
 
 ok | 1 passed | 0 failed ([WILDLINE])
 
---------------------------------
-File       | Branch % | Line % |
---------------------------------
- main.ts   |    100.0 |  100.0 |
---------------------------------
- All files |    100.0 |  100.0 |
---------------------------------
+| File      | Branch % | Line % |
+| --------- | -------- | ------ |
+| main.ts   |    100.0 |  100.0 |
+| All files |    100.0 |  100.0 |
 Lcov coverage report has been generated at [WILDLINE]
 HTML coverage report has been generated at [WILDLINE]
Repository: electron/electron
Pull request: perf: avoid redundant map lookups in `GlobalShortcut`

Backport of #46229

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_global_shortcut.cc
patch: @@ -7,6 +7,7 @@
 #include <string>
 #include <vector>
 
+#include "base/containers/map_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/uuid.h"
 #include "components/prefs/pref_service.h"
@@ -57,22 +58,24 @@ GlobalShortcut::~GlobalShortcut() {
 }
 
 void GlobalShortcut::OnKeyPressed(const ui::Accelerator& accelerator) {
-  if (!accelerator_callback_map_.contains(accelerator)) {
+  if (auto* cb = base::FindOrNull(accelerator_callback_map_, accelerator)) {
+    cb->Run();
+  } else {
     // This should never occur, because if it does,
     // ui::GlobalAcceleratorListener notifies us with wrong accelerator.
     NOTREACHED();
   }
-  accelerator_callback_map_[accelerator].Run();
 }
 
 void GlobalShortcut::ExecuteCommand(const extensions::ExtensionId& extension_id,
                                     const std::string& command_id) {
-  if (!command_callback_map_.contains(command_id)) {
+  if (auto* cb = base::FindOrNull(command_callback_map_, command_id)) {
+    cb->Run();
+  } else {
     // This should never occur, because if it does, GlobalAcceleratorListener
     // notifies us with wrong command.
     NOTREACHED();
   }
-  command_callback_map_[command_id].Run();
 }
 
 bool GlobalShortcut::RegisterAll(
Repository: ollama/ollama
Pull request: fix run arg parser

the bug has no adverse effects other than to the reader. for clarity, rename it to run_parser

Changed files:
filename: ollama/cmd/cli.py
patch: @@ -33,10 +33,10 @@ def main():
     pull_parser.add_argument("model")
     pull_parser.set_defaults(fn=pull)
 
-    pull_parser = subparsers.add_parser("run")
-    pull_parser.add_argument("model")
-    pull_parser.add_argument("prompt", nargs="?")
-    pull_parser.set_defaults(fn=run)
+    run_parser = subparsers.add_parser("run")
+    run_parser.add_argument("model")
+    run_parser.add_argument("prompt", nargs="?")
+    run_parser.set_defaults(fn=run)
 
     args = parser.parse_args()
     args = vars(args)
Repository: nodejs/node
Pull request: lib: remove redundant global RegExps

Small PR that replaces RegExps with `.replaceAll` when possible

Changed files:
filename: lib/internal/util/debuglog.js
patch: @@ -173,7 +173,7 @@ function formatTime(ms) {
 }
 
 function safeTraceLabel(label) {
-  return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');
+  return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
 }
 
 /**

filename: lib/url.js
patch: @@ -704,7 +704,7 @@ Url.prototype.format = function format() {
     }
   }
 
-  search = search.replace(/#/g, '%23');
+  search = search.replaceAll('#', '%23');
 
   if (hash && hash.charCodeAt(0) !== CHAR_HASH)
     hash = '#' + hash;