tweaks type

This commit is contained in:
nai-degen
2023-08-28 03:52:04 -05:00
parent 6453dae433
commit bf13a8b524
+6 -4
View File
@@ -148,10 +148,7 @@ class DatasetPersistence {
});
}
static assertConfigured(input: Config): asserts input is Config & {
hfDatasetRepoUrl: string;
hfPrivateSshKey: string;
} {
static assertConfigured(input: Config): asserts input is ConfigWithDatasets {
if (!input.hfDatasetRepoUrl) {
throw new Error("HF_DATASET_REPO_URL is required when using Datasets.");
}
@@ -162,4 +159,9 @@ class DatasetPersistence {
}
}
type ConfigWithDatasets = Config & {
hfDatasetRepoUrl: string;
hfPrivateSshKey: string;
};
export { DatasetPersistence };