Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
README.md353 linesDownload Raw Back to consola
1# 🐨 Consola2 3> Elegant Console Wrapper4 5[![npm version][npm-version-src]][npm-version-href]6[![npm downloads][npm-downloads-src]][npm-downloads-href]7[![bundle][bundle-src]][bundle-href]8 9<!-- [![Codecov][codecov-src]][codecov-href] -->10 11## Why Consola?12 13👌&nbsp; Easy to use<br>14💅&nbsp; Fancy output with fallback for minimal environments<br>15🔌&nbsp; Pluggable reporters<br>16💻&nbsp; Consistent command line interface (CLI) experience<br>17🏷&nbsp; Tag support<br>18🚏&nbsp; Redirect `console` and `stdout/stderr` to consola and easily restore redirect.<br>19🌐&nbsp; Browser support<br>20⏯&nbsp; Pause/Resume support<br>21👻&nbsp; Mocking support<br>22👮‍♂️&nbsp; Spam prevention by throttling logs<br>23❯&nbsp; Interactive prompt support powered by [`clack`](https://github.com/natemoo-re/clack)<br>24 25## Installation26 27Using npm:28 29```bash30npm i consola31```32 33Using yarn:34 35```bash36yarn add consola37```38 39Using pnpm:40 41```bash42pnpm i consola43```44 45## Getting Started46 47```js48// ESM49import { consola, createConsola } from "consola";50 51// CommonJS52const { consola, createConsola } = require("consola");53 54consola.info("Using consola 3.0.0");55consola.start("Building project...");56consola.warn("A new version of consola is available: 3.0.1");57consola.success("Project built!");58consola.error(new Error("This is an example error. Everything is fine!"));59consola.box("I am a simple box");60await consola.prompt("Deploy to the production?", {61  type: "confirm",62});63```64 65Will display in the terminal:66 67![consola-screenshot](https://github.com/unjs/consola/assets/904724/0e511ee6-2543-43ab-9eda-152f07134d94)68 69You can use smaller core builds without fancy reporter to save 80% of the bundle size:70 71```ts72import { consola, createConsola } from "consola/basic";73import { consola, createConsola } from "consola/browser";74import { createConsola } from "consola/core";75```76 77## Consola Methods78 79#### `<type>(logObject)` `<type>(args...)`80 81Log to all reporters.82 83Example: `consola.info('Message')`84 85#### `await prompt(message, { type, cancel })`86 87Show an input prompt. Type can either of `text`, `confirm`, `select` or `multiselect`.88 89If prompt is canceled by user (with Ctrol+C), default value will be resolved by default. This strategy can be configured by setting `{ cancel: "..." }` option:90 91- `"default"` - Resolve the promise with the `default` value or `initial` value.92- `"undefined`" - Resolve the promise with `undefined`.93- `"null"` - Resolve the promise with `null`.94- `"symbol"` - Resolve the promise with a symbol `Symbol.for("cancel")`.95- `"reject"` - Reject the promise with an error.96 97See [examples/prompt.ts](./examples/prompt.ts) for usage examples.98 99#### `addReporter(reporter)`100 101- Aliases: `add`102 103Register a custom reporter instance.104 105#### `removeReporter(reporter?)`106 107- Aliases: `remove`, `clear`108 109Remove a registered reporter.110 111If no arguments are passed all reporters will be removed.112 113#### `setReporters(reporter|reporter[])`114 115Replace all reporters.116 117#### `create(options)`118 119Create a new `Consola` instance and inherit all parent options for defaults.120 121#### `withDefaults(defaults)`122 123Create a new `Consola` instance with provided defaults124 125#### `withTag(tag)`126 127- Aliases: `withScope`128 129Create a new `Consola` instance with that tag.130 131#### `wrapConsole()` `restoreConsole()`132 133Globally redirect all `console.log`, etc calls to consola handlers.134 135#### `wrapStd()` `restoreStd()`136 137Globally redirect all stdout/stderr outputs to consola.138 139#### `wrapAll()` `restoreAll()`140 141Wrap both, std and console.142 143console uses std in the underlying so calling `wrapStd` redirects console too.144Benefit of this function is that things like `console.info` will be correctly redirected to the corresponding type.145 146#### `pauseLogs()` `resumeLogs()`147 148- Aliases: `pause`/`resume`149 150**Globally** pause and resume logs.151 152Consola will enqueue all logs when paused and then sends them to the reported when resumed.153 154#### `mockTypes`155 156- Aliases: `mock`157 158Mock all types. Useful for using with tests.159 160The first argument passed to `mockTypes` should be a callback function accepting `(typeName, type)` and returning the mocked value:161 162```js163// Jest164consola.mockTypes((typeName, type) => jest.fn());165// Vitest166consola.mockTypes((typeName, type) => vi.fn());167```168 169Please note that with the example above, everything is mocked independently for each type. If you need one mocked fn create it outside:170 171```js172// Jest173const fn = jest.fn();174// Vitest175const fn = vi.fn();176consola.mockTypes(() => fn);177```178 179If callback function returns a _falsy_ value, that type won't be mocked.180 181For example if you just need to mock `consola.fatal`:182 183```js184// Jest185consola.mockTypes((typeName) => typeName === "fatal" && jest.fn());186// Vitest187consola.mockTypes((typeName) => typeName === "fatal" && vi.fn());188```189 190**NOTE:** Any instance of consola that inherits the mocked instance, will apply provided callback again.191This way, mocking works for `withTag` scoped loggers without need to extra efforts.192 193## Custom Reporters194 195Consola ships with 3 built-in reporters out of the box. A fancy colored reporter by default and fallsback to a basic reporter if running in a testing or CI environment detected using [unjs/std-env](https://github.com/unjs/std-env) and a basic browser reporter.196 197You can create a new reporter object that implements `{ log(logObject): () => { } }` interface.198 199**Example:** Simple JSON reporter200 201```ts202import { createConsola } from "consola";203 204const consola = createConsola({205  reporters: [206    {207      log: (logObj) => {208        console.log(JSON.stringify(logObj));209      },210    },211  ],212});213 214// Prints {"date":"2023-04-18T12:43:38.693Z","args":["foo bar"],"type":"log","level":2,"tag":""}215consola.log("foo bar");216```217 218## Log Level219 220Consola only shows logs with configured log level or below. (Default is `3`)221 222Available log levels:223 224- `0`: Fatal and Error225- `1`: Warnings226- `2`: Normal logs227- `3`: Informational logs, success, fail, ready, start, ...228- `4`: Debug logs229- `5`: Trace logs230- `-999`: Silent231- `+999`: Verbose logs232 233You can set the log level by either:234 235- Passing `level` option to `createConsola`236- Setting `consola.level` on instance237- Using the `CONSOLA_LEVEL` environment variable (not supported for browser and core builds).238 239## Log Types240 241Log types are exposed as `consola.[type](...)` and each is a preset of styles and log level.242 243A list of all available built-in types is [available here](./src/constants.ts).244 245## Creating a new instance246 247Consola has a global instance and is recommended to use everywhere.248In case more control is needed, create a new instance.249 250```js251import { createConsola } from "consola";252 253const logger = createConsola({254  // level: 4,255  // fancy: true | false256  // formatOptions: {257  //     columns: 80,258  //     colors: false,259  //     compact: false,260  //     date: false,261  // },262});263```264 265## Integrations266 267### With jest or vitest268 269```js270describe("your-consola-mock-test", () => {271  beforeAll(() => {272    // Redirect std and console to consola too273    // Calling this once is sufficient274    consola.wrapAll();275  });276 277  beforeEach(() => {278    // Re-mock consola before each test call to remove279    // calls from before280    // Jest281    consola.mockTypes(() => jest.fn());282    // Vitest283    consola.mockTypes(() => vi.fn());284  });285 286  test("your test", async () => {287    // Some code here288 289    // Let's retrieve all messages of `consola.log`290    // Get the mock and map all calls to their first argument291    const consolaMessages = consola.log.mock.calls.map((c) => c[0]);292    expect(consolaMessages).toContain("your message");293  });294});295```296 297### With jsdom298 299```js300{301  new jsdom.VirtualConsole().sendTo(consola);302}303```304 305## Console Utils306 307```ts308// ESM309import {310  stripAnsi,311  centerAlign,312  rightAlign,313  leftAlign,314  align,315  box,316  colors,317  getColor,318  colorize,319} from "consola/utils";320 321// CommonJS322const { stripAnsi } = require("consola/utils");323```324 325## Raw logging methods326 327Objects sent to the reporter could lead to unexpected output when object is close to internal object structure containing either `message` or `args` props. To enforce the object to be interpreted as pure object, you can use the `raw` method chained to any log type.328 329**Example:**330 331```js332// Prints "hello"333consola.log({ message: "hello" });334 335// Prints "{ message: 'hello' }"336consola.log.raw({ message: "hello" });337```338 339## License340 341MIT342 343<!-- Badges -->344 345[npm-version-src]: https://img.shields.io/npm/v/consola?style=flat&colorA=18181B&colorB=F0DB4F346[npm-version-href]: https://npmjs.com/package/consola347[npm-downloads-src]: https://img.shields.io/npm/dm/consola?style=flat&colorA=18181B&colorB=F0DB4F348[npm-downloads-href]: https://npmjs.com/package/consola349[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/consola/main?style=flat&colorA=18181B&colorB=F0DB4F350[codecov-href]: https://codecov.io/gh/unjs/consola351[bundle-src]: https://img.shields.io/bundlephobia/min/consola?style=flat&colorA=18181B&colorB=F0DB4F352[bundle-href]: https://bundlephobia.com/result?p=consola353 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai