Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@synsci/plugin": "workspace:*",
"@synsci/sdk": "workspace:*",
"@synsci/util": "workspace:*",
"@zip.js/zip.js": "2.7.62",
"@zip.js/zip.js": "2.23.0",
"ai": "catalog:",
"bun-pty": "0.4.10",
"decimal.js": "10.5.0",
Expand Down
12 changes: 5 additions & 7 deletions backend/cli/src/science/bionemo/download.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Uint8ArrayReader, ZipReader, type Entry } from "@zip.js/zip.js"
import { Uint8ArrayReader, ZipReader, type Entry, type FileEntry } from "@zip.js/zip.js"
import { Network } from "@/settings/network"

const LIMIT = 25 * 1024 * 1024
Expand Down Expand Up @@ -99,12 +99,10 @@ export async function decodeBioNemoResult(bytes: Uint8Array, limit = LIMIT) {
throw new Error(`NVIDIA result ZIP exceeds the ${limit}-byte capture limit`)
entries.push(entry)
}
const payloads = entries.filter((entry) => !entry.directory && entry.filename.endsWith(".response"))
const candidates = payloads.length
? payloads
: entries.filter((entry) => !entry.directory && entry.filename.endsWith(".json"))
if (candidates.length !== 1 || !candidates[0].getData)
throw new Error("NVIDIA result ZIP must contain one JSON response payload")
const files = entries.filter((entry): entry is FileEntry => !entry.directory)
const payloads = files.filter((entry) => entry.filename.endsWith(".response"))
const candidates = payloads.length ? payloads : files.filter((entry) => entry.filename.endsWith(".json"))
if (candidates.length !== 1) throw new Error("NVIDIA result ZIP must contain one JSON response payload")
const chunks: Uint8Array[] = []
let size = 0
await candidates[0].getData(
Expand Down
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading