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
errors.ts142 linesDownload Raw Back to src
1/**2 * An extended version of the `Event` emitted by the `EventSource` object when an error occurs.3 * While the spec does not include any additional properties, we intentionally go beyond the spec4 * and provide some (minimal) additional information to aid in debugging.5 *6 * @public7 */8export class ErrorEvent extends Event {9  /**10   * HTTP status code, if this was triggered by an HTTP error11   * Note: this is not part of the spec, but is included for better error handling.12   *13   * @public14   */15  public code?: number | undefined16 17  /**18   * Optional message attached to the error.19   * Note: this is not part of the spec, but is included for better error handling.20   *21   * @public22   */23  public message?: string | undefined24 25  /**26   * Constructs a new `ErrorEvent` instance. This is typically not called directly,27   * but rather emitted by the `EventSource` object when an error occurs.28   *29   * @param type - The type of the event (should be "error")30   * @param errorEventInitDict - Optional properties to include in the error event31   */32  constructor(33    type: string,34    errorEventInitDict?: {message?: string | undefined; code?: number | undefined},35  ) {36    super(type)37    this.code = errorEventInitDict?.code ?? undefined38    this.message = errorEventInitDict?.message ?? undefined39  }40 41  /**42   * Node.js "hides" the `message` and `code` properties of the `ErrorEvent` instance,43   * when it is `console.log`'ed. This makes it harder to debug errors. To ease debugging,44   * we explicitly include the properties in the `inspect` method.45   *46   * This is automatically called by Node.js when you `console.log` an instance of this class.47   *48   * @param _depth - The current depth49   * @param options - The options passed to `util.inspect`50   * @param inspect - The inspect function to use (prevents having to import it from `util`)51   * @returns A string representation of the error52   */53  [Symbol.for('nodejs.util.inspect.custom')](54    _depth: number,55    options: {colors: boolean},56    inspect: (obj: unknown, inspectOptions: {colors: boolean}) => string,57  ): string {58    return inspect(inspectableError(this), options)59  }60 61  /**62   * Deno "hides" the `message` and `code` properties of the `ErrorEvent` instance,63   * when it is `console.log`'ed. This makes it harder to debug errors. To ease debugging,64   * we explicitly include the properties in the `inspect` method.65   *66   * This is automatically called by Deno when you `console.log` an instance of this class.67   *68   * @param inspect - The inspect function to use (prevents having to import it from `util`)69   * @param options - The options passed to `Deno.inspect`70   * @returns A string representation of the error71   */72  [Symbol.for('Deno.customInspect')](73    inspect: (obj: unknown, inspectOptions: {colors: boolean}) => string,74    options: {colors: boolean},75  ): string {76    return inspect(inspectableError(this), options)77  }78}79 80/**81 * For environments where DOMException may not exist, we will use a SyntaxError instead.82 * While this isn't strictly according to spec, it is very close.83 *84 * @param message - The message to include in the error85 * @returns A `DOMException` or `SyntaxError` instance86 * @internal87 */88export function syntaxError(message: string): SyntaxError {89  // If someone can figure out a way to make this work without depending on DOM/Node.js typings,90  // and without casting to `any`, please send a PR 🙏91 92  // eslint-disable-next-line @typescript-eslint/no-explicit-any93  const DomException = (globalThis as any).DOMException94  if (typeof DomException === 'function') {95    return new DomException(message, 'SyntaxError')96  }97 98  return new SyntaxError(message)99}100 101/**102 * Flatten an error into a single error message string.103 * Unwraps nested errors and joins them with a comma.104 *105 * @param err - The error to flatten106 * @returns A string representation of the error107 * @internal108 */109export function flattenError(err: unknown): string {110  if (!(err instanceof Error)) {111    return `${err}`112  }113 114  if ('errors' in err && Array.isArray(err.errors)) {115    return err.errors.map(flattenError).join(', ')116  }117 118  if ('cause' in err && err.cause instanceof Error) {119    return `${err}: ${flattenError(err.cause)}`120  }121 122  return err.message123}124 125/**126 * Convert an `ErrorEvent` instance into a plain object for inspection.127 *128 * @param err - The `ErrorEvent` instance to inspect129 * @returns A plain object representation of the error130 * @internal131 */132function inspectableError(err: ErrorEvent) {133  return {134    type: err.type,135    message: err.message,136    code: err.code,137    defaultPrevented: err.defaultPrevented,138    cancelable: err.cancelable,139    timeStamp: err.timeStamp,140  }141}142 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai