Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
wfjsw committed Aug 9, 2024
0 parents commit e369359
Show file tree
Hide file tree
Showing 13 changed files with 772 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.5.1
3 changes: 3 additions & 0 deletions .script/env.ts
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;
14 changes: 14 additions & 0 deletions .script/hub.ts
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 added .script/index.ts
Empty file.
9 changes: 9 additions & 0 deletions .script/interfaces.ts
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[];
}
Loading

0 comments on commit e369359

Please sign in to comment.