File size: 2,784 Bytes
21dd449 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
import type { License, SpaceRuntime, SpaceSdk } from "../public";
type Color = "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink" | "gray";
export interface ApiSpaceInfo {
_id: string;
id: string;
arxivIds?: string[];
author: string;
cardExists?: true;
cardError?: unknown;
cardData?: unknown;
contributors?: Array<{ user: string; _id: string }>;
disabled: boolean;
discussionsDisabled: boolean;
duplicationDisabled: boolean;
gated: false | "auto" | "manual";
gitalyUid: string;
lastAuthor: { email: string; user?: string };
lastModified: string; // date
likes: number;
likesRecent: number;
private: boolean;
updatedAt: string; // date
createdAt: string; // date
tags: string[];
sha: string;
subdomain: string;
title: string;
emoji: string;
colorFrom: Color;
colorTo: Color;
pinned: boolean;
siblings: Array<{ rfilename: string }>;
sdk?: SpaceSdk;
runtime?: SpaceRuntime;
models?: string[];
datasets?: string[];
originSpace?: { _id: string; authorId: string };
}
export interface ApiSpaceMetadata {
license?: License | License[];
tags?: string[];
title?: string;
colorFrom?: "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink" | "gray";
colorTo?: "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink" | "gray";
emoji?: string;
sdk?: "streamlit" | "gradio" | "docker" | "static";
sdk_version?: string | string;
python_version?: string | string;
fullWidth?: boolean;
header?: "mini" | "default";
app_file?: string;
app_port?: number;
base_path?: string;
models?: string[];
datasets?: string[];
pinned?: boolean;
metaTitle?: string;
description?: string;
thumbnail?: string;
/**
* If enabled, will associate an oauth app to the Space, adding variables and secrets to the Space's environment
*/
hf_oauth?: boolean;
/**
* The expiration of access tokens for your oauth app in minutes. max 30 days (43,200 minutes). Defaults to 8 hours (480 minutes)
*/
hf_oauth_expiration_minutes?: number;
/**
* OAuth scopes to request. By default you have access to the user's profile, you can request access to their repos or inference-api.
*/
hf_oauth_scopes?: ("email" | "read-repos" | "write-repos" | "manage-repos" | "inference-api")[];
suggested_hardware?:
| "cpu-basic"
| "zero-a10g"
| "cpu-upgrade"
| "cpu-xl"
| "t4-small"
| "t4-medium"
| "a10g-small"
| "a10g-large"
| "a10g-largex2"
| "a10g-largex4"
| "a100-large";
suggested_storage?: "small" | "medium" | "large";
custom_headers?: {
"cross-origin-embedder-policy"?: "unsafe-none" | "require-corp" | "credentialless";
"cross-origin-opener-policy"?: "same-origin" | "same-origin-allow-popups" | "unsafe-none";
"cross-origin-resource-policy"?: "same-site" | "same-origin" | "cross-origin";
};
}
|