-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e369359
Showing
13 changed files
with
772 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v22.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import {env} from 'node:process' | ||
|
||
export const HF_TOKEN = env?.HF_TOKEN as string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { listFiles } from "@huggingface/hub"; | ||
import { HF_TOKEN } from "./env"; | ||
|
||
export async function getMetadata(repoId: string, revision: string) { | ||
const files = []; | ||
const remoteFiles = listFiles({ repo: repoId, revision, recursive: true, credentials: { accessToken: HF_TOKEN } }); | ||
for await (const file of remoteFiles) { | ||
files.push({ | ||
filename: file.path, | ||
size: file.size, | ||
sha256: file.lfs?.oid, | ||
}); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export interface IProvider { | ||
identifier: string; | ||
toProviderUrl(path: string, revision: string, args: unknown): string; | ||
} | ||
|
||
export interface GlobalArgs { | ||
whitelist?: string[]; | ||
blacklist?: string[]; | ||
} |
Oops, something went wrong.