Skip to content

Commit c565b6b

Browse files
authored
Fix modelInfo typing (#998)
Fix #996
1 parent a965b74 commit c565b6b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/hub/src/lib/model-info.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ describe("modelInfo", () => {
55
it("should return the model info", async () => {
66
const info = await modelInfo({
77
name: "openai-community/gpt2",
8+
additionalFields: ["author"],
89
});
910
expect(info).toEqual({
1011
id: "621ffdc036468d709f17434d",
1112
downloads: expect.any(Number),
13+
author: "openai-community",
1214
gated: false,
1315
name: "openai-community/gpt2",
1416
updatedAt: expect.any(Date),

packages/hub/src/lib/model-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { pick } from "../utils/pick";
77
import { MODEL_EXPAND_KEYS, type MODEL_EXPANDABLE_KEYS, type ModelEntry } from "./list-models";
88

99
export async function modelInfo<
10-
const T extends Exclude<(typeof MODEL_EXPANDABLE_KEYS)[number], (typeof MODEL_EXPANDABLE_KEYS)[number]> = never,
10+
const T extends Exclude<(typeof MODEL_EXPANDABLE_KEYS)[number], (typeof MODEL_EXPAND_KEYS)[number]> = never,
1111
>(
1212
params: {
1313
name: string;

0 commit comments

Comments
 (0)