Spaces:
Sleeping
Sleeping
Andrew
commited on
Commit
·
c6cfc55
1
Parent(s):
bac49ce
refactor(admin): Use template literals for export logging
Browse files
src/routes/admin/export/+server.ts
CHANGED
|
@@ -42,7 +42,7 @@ export async function POST({ request }) {
|
|
| 42 |
const writer = await parquet.ParquetWriter.openFile(schema, fileName);
|
| 43 |
|
| 44 |
let count = 0;
|
| 45 |
-
logger.info(
|
| 46 |
|
| 47 |
for await (const conversation of collections.settings.aggregate<{
|
| 48 |
title: string;
|
|
@@ -89,7 +89,7 @@ export async function POST({ request }) {
|
|
| 89 |
++count;
|
| 90 |
|
| 91 |
if (count % 1_000 === 0) {
|
| 92 |
-
logger.info(
|
| 93 |
}
|
| 94 |
}
|
| 95 |
|
|
@@ -134,13 +134,13 @@ export async function POST({ request }) {
|
|
| 134 |
++count;
|
| 135 |
|
| 136 |
if (count % 1_000 === 0) {
|
| 137 |
-
logger.info(
|
| 138 |
}
|
| 139 |
}
|
| 140 |
|
| 141 |
await writer.close();
|
| 142 |
|
| 143 |
-
logger.info(
|
| 144 |
|
| 145 |
await uploadFile({
|
| 146 |
file: pathToFileURL(fileName) as URL,
|
|
|
|
| 42 |
const writer = await parquet.ParquetWriter.openFile(schema, fileName);
|
| 43 |
|
| 44 |
let count = 0;
|
| 45 |
+
logger.info(`Exporting conversations for model ${model}`);
|
| 46 |
|
| 47 |
for await (const conversation of collections.settings.aggregate<{
|
| 48 |
title: string;
|
|
|
|
| 89 |
++count;
|
| 90 |
|
| 91 |
if (count % 1_000 === 0) {
|
| 92 |
+
logger.info(`Exported ${count} conversations`);
|
| 93 |
}
|
| 94 |
}
|
| 95 |
|
|
|
|
| 134 |
++count;
|
| 135 |
|
| 136 |
if (count % 1_000 === 0) {
|
| 137 |
+
logger.info(`Exported ${count} conversations`);
|
| 138 |
}
|
| 139 |
}
|
| 140 |
|
| 141 |
await writer.close();
|
| 142 |
|
| 143 |
+
logger.info(`Uploading ${fileName} to Hugging Face Hub`);
|
| 144 |
|
| 145 |
await uploadFile({
|
| 146 |
file: pathToFileURL(fileName) as URL,
|