helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: FAQ: answer a few faq questions


Changed files:
filename: docs/faq.md
patch: @@ -1,5 +1,10 @@
 # FAQ
 
+- [How can I view the logs?](#how-can-i-view-the-logs)
+- [How can I expose Ollama on my network?](#how-can-i-expose-ollama-on-my-network)
+- [How can I allow additional web origins to access Ollama?](#how-can-i-allow-additional-web-origins-to-access-ollama)
+- [Where are models stored?](#where-are-models-stored)
+
 ## How can I view the logs?
 
 On macOS:
@@ -74,8 +79,6 @@ systemctl restart ollama
 - macOS: Raw model data is stored under `~/.ollama/models`.
 - Linux: Raw model data is stored under `/usr/share/ollama/.ollama/models`
 
-
-
 Below the models directory you will find a structure similar to the following:
 
 ```shell
@@ -96,3 +99,11 @@ The manifest lists all the layers used in this model. You will see a `media type
 ### How can I change where Ollama stores models?
 
 To modify where models are stored, you can use the `OLLAMA_MODELS` environment variable. Note that on Linux this means defining `OLLAMA_MODELS` in a drop-in `/etc/systemd/system/ollama.service.d` service file, reloading systemd, and restarting the ollama service.
+
+## Does Ollama send my prompts and answers back to Ollama.ai to use in any way?
+
+No. Anything you do with Ollama, such as generate a response from the model, stays with you. We don't collect any data about how you use the model. You are always in control of your own data.
+
+## How can I use Ollama in VSCode to help me code?
+
+There is already a large collection of plugins available for VSCode as well as other editors that leverage Ollama. You can see the list of plugins at the bottom of the main repository readme.
Repository: nodejs/node
Pull request: doc: add missing comma in `child_process.md`

doc: add comma after "blocks" for clarity in child_process.md

This PR improves clarity in doc/api/child_process.md by adding a comma after the word "blocks" in the sentence:

>... the subprocess blocks, waiting for the pipe buffer to accept more data. ...

The change improves readability and ensures proper grammatical flow. No functional code is affected.

No functional code is affected.

<!--
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: doc/api/child_process.md
patch: @@ -48,7 +48,7 @@ By default, pipes for `stdin`, `stdout`, and `stderr` are established between
 the parent Node.js process and the spawned subprocess. These pipes have
 limited (and platform-specific) capacity. If the subprocess writes to
 stdout in excess of that limit without the output being captured, the
-subprocess blocks waiting for the pipe buffer to accept more data. This is
+subprocess blocks, waiting for the pipe buffer to accept more data. This is
 identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`
 option if the output will not be consumed.
Repository: ollama/ollama
Pull request: replace go-humanize with format.HumanBytes


Changed files:
filename: cmd/cmd.go
patch: @@ -20,7 +20,6 @@ import (
 	"syscall"
 	"time"
 
-	"github.com/dustin/go-humanize"
 	"github.com/olekukonko/tablewriter"
 	"github.com/spf13/cobra"
 	"golang.org/x/crypto/ssh"
@@ -173,7 +172,7 @@ func ListHandler(cmd *cobra.Command, args []string) error {
 
 	for _, m := range models.Models {
 		if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) {
-			data = append(data, []string{m.Name, m.Digest[:12], humanize.Bytes(uint64(m.Size)), format.HumanTime(m.ModifiedAt, "Never")})
+			data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), format.HumanTime(m.ModifiedAt, "Never")})
 		}
 	}
 

filename: format/bytes.go
patch: @@ -12,11 +12,11 @@ const (
 func HumanBytes(b int64) string {
 	switch {
 	case b > GigaByte:
-		return fmt.Sprintf("%d GB", b/GigaByte)
+		return fmt.Sprintf("%.1f GB", float64(b)/GigaByte)
 	case b > MegaByte:
-		return fmt.Sprintf("%d MB", b/MegaByte)
+		return fmt.Sprintf("%.1f MB", float64(b)/MegaByte)
 	case b > KiloByte:
-		return fmt.Sprintf("%d KB", b/KiloByte)
+		return fmt.Sprintf("%.1f KB", float64(b)/KiloByte)
 	default:
 		return fmt.Sprintf("%d B", b)
 	}

filename: go.mod
patch: @@ -3,7 +3,6 @@ module github.com/jmorganca/ollama
 go 1.20
 
 require (
-	github.com/dustin/go-humanize v1.0.1
 	github.com/emirpasic/gods v1.18.1
 	github.com/gin-gonic/gin v1.9.1
 	github.com/mattn/go-runewidth v0.0.14

filename: go.sum
patch: @@ -9,8 +9,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
-github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
 github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
 github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
 github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
Repository: facebook/react
Pull request: Build react-reconciler for FB builds

Meta uses various tools built on top of the "react-reconciler" package but that package needs to match the version of the "react" package.

This means that it should be synced at the same time. However, more than that the feature flags between the "react" package and the "react-reconciler" package needs to line up. Since FB has custom feature flags, it can't use the OSS version of react-reconciler.


Changed files:
filename: scripts/rollup/bundles.js
patch: @@ -782,7 +782,7 @@ const bundles = [
 
   /******* React Reconciler *******/
   {
-    bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING],
+    bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING, FB_WWW_DEV, FB_WWW_PROD],
     moduleType: RECONCILER,
     entry: 'react-reconciler',
     global: 'ReactReconciler',

filename: scripts/rollup/wrappers.js
patch: @@ -204,6 +204,47 @@ module.exports.default = module.exports;
 Object.defineProperty(module.exports, "__esModule", { value: true });
 `;
   },
+
+  /***************** FB_WWW_DEV (reconciler only) *****************/
+  [FB_WWW_DEV](source, globalName, filename, moduleType) {
+    return `'use strict';
+
+if (__DEV__) {
+  module.exports = function $$$reconciler($$$config) {
+    var exports = {};
+${source}
+    return exports;
+  };
+  module.exports.default = module.exports;
+  Object.defineProperty(module.exports, "__esModule", { value: true });
+}
+`;
+  },
+
+  /***************** FB_WWW_PROD (reconciler only) *****************/
+  [FB_WWW_PROD](source, globalName, filename, moduleType) {
+    return `module.exports = function $$$reconciler($$$config) {
+
+      var exports = {};
+  ${source}
+      return exports;
+  };
+  module.exports.default = module.exports;
+  Object.defineProperty(module.exports, "__esModule", { value: true });
+  `;
+  },
+
+  /***************** FB_WWW_PROFILING (reconciler only) *****************/
+  [FB_WWW_PROFILING](source, globalName, filename, moduleType) {
+    return `module.exports = function $$$reconciler($$$config) {
+      var exports = {};
+  ${source}
+      return exports;
+  };
+  module.exports.default = module.exports;
+  Object.defineProperty(module.exports, "__esModule", { value: true });
+  `;
+  },
 };
 
 const licenseHeaderWrappers = {
Repository: denoland/deno
Pull request: fix(ext/node): handle empty writes in chunked HTTP requests

Should fix https://github.com/denoland/deno/issues/31056

Changed files:
filename: ext/node/polyfills/_http_outgoing.ts
patch: @@ -561,6 +561,10 @@ Object.defineProperties(
             });
           }
         });
+      } else {
+        // For empty writes, call callback and emit drain to maintain flow control
+        callback?.();
+        this.emit("drain");
       }
       return false;
     },

filename: tests/unit_node/http_test.ts
patch: @@ -2181,3 +2181,46 @@ Deno.test("[node/http] server.listen respects signal option", async () => {
   `);
   assertEquals(exitCode, 0);
 });
+
+// Test for empty chunk in chunked POST request
+// Regression test for: https://github.com/denoland/deno/issues/31056
+Deno.test("[node/http] client request with empty write in chunked POST completes", async () => {
+  const { promise, resolve } = Promise.withResolvers<void>();
+  let requestBody = "";
+
+  const server = http.createServer((req, res) => {
+    let body = "";
+    req.on("data", (chunk) => {
+      body += chunk.toString();
+    });
+
+    req.on("end", () => {
+      requestBody = body;
+      res.statusCode = 200;
+      res.end("OK");
+    });
+  });
+
+  server.listen(() => {
+    const { port } = server.address() as { port: number };
+
+    const req = http.request({
+      hostname: "localhost",
+      port,
+      path: "/",
+      method: "POST",
+    }, (res) => {
+      res.on("data", () => {});
+      res.on("end", () => {
+        server.close(() => resolve());
+      });
+    });
+
+    // This should complete successfully even with an empty write
+    req.write("");
+    req.end();
+  });
+
+  await promise;
+  assertEquals(requestBody, "");
+});
Repository: ollama/ollama
Pull request: Move /generate format to optional parameters

This field is optional and should be under the `Advanced parameters` header

Changed files:
filename: docs/api.md
patch: @@ -38,10 +38,10 @@ Generate a response for a given prompt with a provided model. This is a streamin
 
 - `model`: (required) the [model name](#model-names)
 - `prompt`: the prompt to generate a response for
-- `format`: the format to return a response in. Currently the only accepted value is `json`
 
 Advanced parameters (optional):
 
+- `format`: the format to return a response in. Currently the only accepted value is `json`
 - `options`: additional model parameters listed in the documentation for the [Modelfile](./modelfile.md#valid-parameters-and-values) such as `temperature`
 - `system`: system prompt to (overrides what is defined in the `Modelfile`)
 - `template`: the full prompt or prompt template (overrides what is defined in the `Modelfile`)
Repository: nodejs/node
Pull request: deps: update googletest to 35b75a2

This is an automated update of googletest to 35b75a2.

Changed files:
filename: deps/googletest/include/gtest/gtest-matchers.h
patch: @@ -773,6 +773,35 @@ class GeMatcher
   static const char* NegatedDesc() { return "isn't >="; }
 };
 
+// Same as `EqMatcher<Rhs>`, except that the `rhs` is stored as `StoredRhs` and
+// must be implicitly convertible to `Rhs`.
+template <typename Rhs, typename StoredRhs>
+class ImplicitCastEqMatcher {
+ public:
+  explicit ImplicitCastEqMatcher(const StoredRhs& rhs) : stored_rhs_(rhs) {}
+
+  using is_gtest_matcher = void;
+
+  template <typename Lhs>
+  bool MatchAndExplain(const Lhs& lhs, std::ostream*) const {
+    return lhs == rhs();
+  }
+
+  void DescribeTo(std::ostream* os) const {
+    *os << "is equal to ";
+    UniversalPrint(rhs(), os);
+  }
+  void DescribeNegationTo(std::ostream* os) const {
+    *os << "isn't equal to ";
+    UniversalPrint(rhs(), os);
+  }
+
+ private:
+  Rhs rhs() const { return ImplicitCast_<Rhs>(stored_rhs_); }
+
+  StoredRhs stored_rhs_;
+};
+
 template <typename T, typename = typename std::enable_if<
                           std::is_constructible<std::string, T>::value>::type>
 using StringLike = T;

filename: deps/googletest/src/gtest.cc
patch: @@ -269,6 +269,13 @@ GTEST_DEFINE_bool_(
     "True if and only if the test should fail if no test case (including "
     "disabled test cases) is linked.");
 
+GTEST_DEFINE_bool_(
+    fail_if_no_test_selected,
+    testing::internal::BoolFromGTestEnv("fail_if_no_test_selected", false),
+    "True if and only if the test should fail if no test case is selected to "
+    "run. A test case is selected to run if it is not disabled and is matched "
+    "by the filter flag so that it starts executing.");
+
 GTEST_DEFINE_bool_(
     also_run_disabled_tests,
     testing::internal::BoolFromGTestEnv("also_run_disabled_tests", false),
@@ -6079,6 +6086,14 @@ bool UnitTestImpl::RunAllTests() {
                       TearDownEnvironment);
         repeater->OnEnvironmentsTearDownEnd(*parent_);
       }
+    } else if (GTEST_FLAG_GET(fail_if_no_test_selected)) {
+      // If there were no tests to run, bail if we were requested to be strict.
+      constexpr char kNoTestsSelectedMessage[] =
+          "No tests were selected to run. Please make sure at least one test "
+          "exists and is not disabled! If the test is sharded, you may have "
+          "defined more shards than test cases, which is wasteful.";
+      ColoredPrintf(GTestColor::kRed, "%s\n", kNoTestsSelectedMessage);
+      return false;
     }
 
     elapsed_time_ = timer.Elapsed();
@@ -6763,6 +6778,7 @@ static bool ParseGoogleTestFlag(const char* const arg) {
   GTEST_INTERNAL_PARSE_FLAG(death_test_use_fork);
   GTEST_INTERNAL_PARSE_FLAG(fail_fast);
   GTEST_INTERNAL_PARSE_FLAG(fail_if_no_test_linked);
+  GTEST_INTERNAL_PARSE_FLAG(fail_if_no_test_selected);
   GTEST_INTERNAL_PARSE_FLAG(filter);
   GTEST_INTERNAL_PARSE_FLAG(internal_run_death_test);
   GTEST_INTERNAL_PARSE_FLAG(list_tests);
Repository: ggml-org/llama.cpp
Pull request: Revert "ggml-cpu: detect correct cpu flags for arm64 (#16229) (#16239)"

This reverts commit 7c23f3f0d4b9f5d6ea140756eb694b562d5acebb.


Changed files:
filename: ggml/src/ggml-cpu/CMakeLists.txt
patch: @@ -118,18 +118,18 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
                 # so we check for them manually and enable them if available
 
                 execute_process(
-                    COMMAND ${CMAKE_C_COMPILER} -march=native -E -v -
+                    COMMAND ${CMAKE_C_COMPILER} -mcpu=native -E -v -
                     INPUT_FILE "/dev/null"
                     OUTPUT_QUIET
                     ERROR_VARIABLE ARM_MCPU
                     RESULT_VARIABLE ARM_MCPU_RESULT
                 )
                 if (NOT ARM_MCPU_RESULT)
-                    string(REGEX MATCH "-march=[^ ']+" ARM_MCPU_FLAG "${ARM_MCPU}")
+                    string(REGEX MATCH "-mcpu=[^ ']+" ARM_MCPU_FLAG "${ARM_MCPU}")
                 endif()
                 if ("${ARM_MCPU_FLAG}" STREQUAL "")
-                    set(ARM_MCPU_FLAG -march=native)
-                    message(STATUS "ARM -mcpu not found, -march=native will be used")
+                    set(ARM_MCPU_FLAG -mcpu=native)
+                    message(STATUS "ARM -mcpu not found, -mcpu=native will be used")
                 endif()
 
                 include(CheckCXXSourceRuns)
Repository: ollama/ollama
Pull request: Use `stdout` file descriptor to determine terminal size


Changed files:
filename: cmd/cmd.go
patch: @@ -398,7 +398,7 @@ func generate(cmd *cobra.Command, model, prompt string, wordWrap bool, format st
 		generateContext = []int{}
 	}
 
-	termWidth, _, err := term.GetSize(int(0))
+	termWidth, _, err := term.GetSize(int(os.Stdout.Fd()))
 	if err != nil {
 		wordWrap = false
 	}
Repository: facebook/react
Pull request: Revert "Support writing to this.refs from userspace"

Reverts facebook/react#28867

It broke some tests, reverting until we figure out why to avoid having too much delay in the sync.

Changed files:
filename: packages/react-reconciler/src/ReactFiberClassComponent.js
patch: @@ -819,6 +819,7 @@ function mountClassInstance(
   const instance = workInProgress.stateNode;
   instance.props = newProps;
   instance.state = workInProgress.memoizedState;
+  instance.refs = {};
 
   initializeUpdateQueue(workInProgress);
 

filename: packages/react-reconciler/src/__tests__/ReactFiberRefs-test.js
patch: @@ -138,28 +138,4 @@ describe('ReactFiberRefs', () => {
     );
     expect(refProp).toBe('child');
   });
-
-  test('strings refs can be codemodded to callback refs', async () => {
-    let app;
-    class App extends React.Component {
-      render() {
-        app = this;
-        return (
-          <div
-            prop="Hello!"
-            ref={el => {
-              // `refs` used to be a shared frozen object unless/until a string
-              // ref attached by the reconciler, but it's not anymore so that we
-              // can codemod string refs to userspace callback refs.
-              this.refs.div = el;
-            }}
-          />
-        );
-      }
-    }
-
-    const root = ReactNoop.createRoot();
-    await act(() => root.render(<App />));
-    expect(app.refs.div.prop).toBe('Hello!');
-  });
 });

filename: packages/react/src/ReactBaseClasses.js
patch: @@ -8,13 +8,19 @@
 import ReactNoopUpdateQueue from './ReactNoopUpdateQueue';
 import assign from 'shared/assign';
 
+const emptyObject = {};
+if (__DEV__) {
+  Object.freeze(emptyObject);
+}
+
 /**
  * Base class helpers for the updating state of a component.
  */
 function Component(props, context, updater) {
   this.props = props;
   this.context = context;
-  this.refs = {};
+  // If a component has string refs, we will assign a different object later.
+  this.refs = emptyObject;
   // We initialize the default updater but the real one gets injected by the
   // renderer.
   this.updater = updater || ReactNoopUpdateQueue;
@@ -127,7 +133,7 @@ function PureComponent(props, context, updater) {
   this.props = props;
   this.context = context;
   // If a component has string refs, we will assign a different object later.
-  this.refs = {};
+  this.refs = emptyObject;
   this.updater = updater || ReactNoopUpdateQueue;
 }
Repository: denoland/deno
Pull request: fix(ext/http): display localhost url once on windows

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->

On Windows, `Deno.serve` listening log looks like this:
```sh
Listening on http://localhost:8000/ (http://localhost:8000/)
```
Displaying `(http://localhost:8000/)` is redundant, so this PR changes it to display the following:
```sh
Listening on http://localhost:8000/
```

Changed files:
filename: ext/http/00_serve.ts
patch: @@ -933,7 +933,8 @@ function serveInner(options, handler) {
       const host = formatHostName(addr.hostname);
 
       const url = `${scheme}${host}:${addr.port}/`;
-      const helper = addr.hostname === "0.0.0.0" || addr.hostname === "::"
+      const helper = host !== "localhost" &&
+          (addr.hostname === "0.0.0.0" || addr.hostname === "::")
         ? ` (${scheme}localhost:${addr.port}/)`
         : "";
 

filename: tests/specs/run/serve/__test__.jsonc
patch: @@ -5,6 +5,11 @@
       "output": "on_listen_default.out",
       "if": "unix"
     },
+    "on_listen_default_windows": {
+      "args": "run -A on_listen_default.ts",
+      "output": "on_listen_default_windows.out",
+      "if": "windows"
+    },
     "ipv6_hostname": {
       "args": "run -A ipv6_hostname.ts",
       "output": "ipv6_hostname.out",

filename: tests/specs/run/serve/on_listen_default_windows.out
patch: @@ -0,0 +1 @@
+Listening on http://localhost:[WILDCARD]/
Repository: ollama/ollama
Pull request: Add Dart library to README.md

Good afternoon!

I have completed the first version of the Ollama library for Dart, making it possible to integrate Ollama into Flutter applications. I thought it would be nice to mention it in the readme file.

![](https://media.giphy.com/media/3oNMQtqpnse0dbFe06/giphy.gif)

Changed files:
filename: README.md
patch: @@ -243,6 +243,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Ollama4j for Java](https://github.com/amithkoujalgi/ollama4j)
 - [ModelFusion Typescript Library](https://modelfusion.dev/integration/model-provider/ollama)
 - [OllamaKit for Swift](https://github.com/kevinhermawan/OllamaKit)
+- [Ollama for Dart](https://github.com/breitburg/dart-ollama)
 
 ### Extensions & Plugins
Repository: ggml-org/llama.cpp
Pull request: server : print the samplers chain for each request

This is useful for debugging to track which samplers are being used:

```
0.06.413.534 I slot get_availabl: id  3 | task -1 | selected slot by LCP similarity, sim_best = 1.000 (> 0.100 thold), f_keep = 0.687
0.06.413.669 I slot launch_slot_: id  3 | task -1 | sampler chain: logits -> logit-bias -> penalties -> dry -> top-n-sigma -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist 
0.06.413.690 I slot launch_slot_: id  3 | task 38 | processing task
```

Changed files:
filename: tools/server/server.cpp
patch: @@ -2823,6 +2823,8 @@ struct server_context {
                 send_error(task, "Failed to parse grammar", ERROR_TYPE_INVALID_REQUEST);
                 return false;
             }
+
+            SLT_INF(slot, "sampler chain: %s\n", common_sampler_print(slot.smpl).c_str());
         }
 
         // initialize draft batch