Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gguf updates #543

Merged
merged 4 commits into from Mar 12, 2024
Merged

Gguf updates #543

merged 4 commits into from Mar 12, 2024

Conversation

mishig25
Copy link
Collaborator

@mishig25 mishig25 commented Mar 11, 2024

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one suggestion, other than that lgtm, thanks!

@@ -185,8 +188,8 @@ export interface GGUFParseOutput {
tensorInfos: GGUFTensorInfo[];
}

export async function gguf(url: string): Promise<GGUFParseOutput> {
const r = new RangeView(url);
export async function gguf(url: string, _fetch: typeof fetch = fetch): Promise<GGUFParseOutput> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export async function gguf(url: string, _fetch: typeof fetch = fetch): Promise<GGUFParseOutput> {
export async function gguf(url: string, params: {
/**
* Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.
*/
fetch?: typeof fetch;
}): Promise<GGUFParseOutput> {

any way to pass it like this for consistency with safetensors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export async function gguf(url: string): Promise<GGUFParseOutput> {
const r = new RangeView(url);
export async function gguf(url: string, _fetch: typeof fetch = fetch): Promise<GGUFParseOutput> {
const r = new RangeView(url, _fetch);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -223,7 +226,7 @@ export async function gguf(url: string): Promise<GGUFParseOutput> {
throw new Error("Unsupported metadata type: " + valueType);
}

let valueResult: { value: MetadataValue; newOffset: number } | undefined;
let valueResult: ReturnType<typeof readMetadataValue> | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mishig25 mishig25 merged commit 8ec3643 into gguf Mar 12, 2024
2 checks passed
@mishig25 mishig25 deleted the gguf_updates branch March 12, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants