Skip to content

[gguf] Fx type in "should parse a local file" #660

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

Merged
merged 1 commit into from
May 10, 2024
Merged

Conversation

mishig25
Copy link
Collaborator

@mishig25 mishig25 commented May 10, 2024

Follow up to #656

cc: @ngxson

@mishig25 mishig25 requested a review from julien-c as a code owner May 10, 2024 08:37
@@ -237,7 +237,7 @@ describe("gguf", () => {
fs.writeFileSync(".cache/model.gguf", Buffer.from(arrayBuf));

const { metadata } = await gguf(".cache/model.gguf", { allowLocalFile: true });
expect(metadata["general.name"]).toEqual("tinyllamas-stories-260k");
expect(metadata).toMatchObject({ "general.name": "tinyllamas-stories-260k" });
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

otherwise, it was giving this error:

Error: src/gguf.spec.ts(240,10): error TS7053: Element implicitly has an 'any' type because expression of type '"general.name"' can't be used to index type 'GGUFMetadata<{ strict: true; }>'.
Property 'general.name' does not exist on type 'GGUFMetadata<{ strict: true; }>'.
/home/runner/work/huggingface.js/huggingface.js/packages/gguf:

@mishig25 mishig25 requested a review from coyotte508 May 10, 2024 08:38
@ngxson
Copy link
Member

ngxson commented May 10, 2024

Thank you! LGTM.

I was quite surprise that it isn't got catch by pnpm run lint:check. Do you have any idea why? (Or maybe because my branch is not up-to-date, so there's lint config that I didn't know about)

@mishig25 mishig25 merged commit 30d02eb into main May 10, 2024
@mishig25 mishig25 deleted the fix_gguf_check branch May 10, 2024 09:21
@mishig25
Copy link
Collaborator Author

I was quite surprise that it isn't got catch by pnpm run lint:check

indeed, pnpm run lint:check didn't catch it. But the tests on huggingface.js were failing. Maybe @coyotte508 knows why

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.

3 participants