From e2502169c3dccbf0d0b0c7d24054d225ce1bbc78 Mon Sep 17 00:00:00 2001 From: Mishig Date: Thu, 28 Mar 2024 05:49:38 -0700 Subject: [PATCH] [gguf] add `RE_GGUF_FILE` regex (#587) Add gguf equavalent of https://github.com/huggingface/huggingface.js/blob/2bfaa65fe895fc00e65879999225d238f43ef9b0/packages/hub/src/lib/parse-safetensors-metadata.ts#L15-L16 --- packages/gguf/src/gguf.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/gguf/src/gguf.ts b/packages/gguf/src/gguf.ts index 4b963b7ca..5cb46f7ae 100644 --- a/packages/gguf/src/gguf.ts +++ b/packages/gguf/src/gguf.ts @@ -4,6 +4,8 @@ import { GGUFValueType } from "./types"; export type { MetadataBaseValue, MetadataValue, Version, GGUFMetadata, GGUFTensorInfo, GGUFParseOutput } from "./types"; export { GGUFValueType, GGMLQuantizationType } from "./types"; +export const RE_GGUF_FILE = /\.gguf$/; + const isVersion = (version: number): version is Version => version === 1 || version === 2 || version === 3; /**