diff --git a/packages/gguf/src/gguf.ts b/packages/gguf/src/gguf.ts index f8cf45c5c..25f41252f 100644 --- a/packages/gguf/src/gguf.ts +++ b/packages/gguf/src/gguf.ts @@ -64,6 +64,7 @@ class RangeView { * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. */ fetch?: typeof fetch; + additionalFetchHeaders?: Record; } ) { this.chunk = 0; @@ -82,6 +83,7 @@ class RangeView { await ( await (this.params?.fetch ?? fetch)(this.url, { headers: { + ...(this.params?.additionalFetchHeaders ?? {}), Range: `bytes=${range[0]}-${range[1]}`, }, }) @@ -209,6 +211,7 @@ export async function gguf( * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. */ fetch?: typeof fetch; + additionalFetchHeaders?: Record; computeParametersCount: true; } ): Promise; @@ -219,6 +222,7 @@ export async function gguf( * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. */ fetch?: typeof fetch; + additionalFetchHeaders?: Record; } ): Promise; export async function gguf( @@ -228,6 +232,7 @@ export async function gguf( * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. */ fetch?: typeof fetch; + additionalFetchHeaders?: Record; computeParametersCount?: boolean; } ): Promise {