Skip to content

Commit

Permalink
Fix modelInfo typing (#998)
Browse files Browse the repository at this point in the history
Fix #996
  • Loading branch information
coyotte508 authored Oct 30, 2024
1 parent a965b74 commit c565b6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/hub/src/lib/model-info.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ describe("modelInfo", () => {
it("should return the model info", async () => {
const info = await modelInfo({
name: "openai-community/gpt2",
additionalFields: ["author"],
});
expect(info).toEqual({
id: "621ffdc036468d709f17434d",
downloads: expect.any(Number),
author: "openai-community",
gated: false,
name: "openai-community/gpt2",
updatedAt: expect.any(Date),
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/model-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { pick } from "../utils/pick";
import { MODEL_EXPAND_KEYS, type MODEL_EXPANDABLE_KEYS, type ModelEntry } from "./list-models";

export async function modelInfo<
const T extends Exclude<(typeof MODEL_EXPANDABLE_KEYS)[number], (typeof MODEL_EXPANDABLE_KEYS)[number]> = never,
const T extends Exclude<(typeof MODEL_EXPANDABLE_KEYS)[number], (typeof MODEL_EXPAND_KEYS)[number]> = never,
>(
params: {
name: string;
Expand Down

0 comments on commit c565b6b

Please sign in to comment.