(weightsManifest: WeightsManifestConfig)
| 208 | } |
| 209 | |
| 210 | private async getWeightUrls(weightsManifest: WeightsManifestConfig): |
| 211 | Promise<string[]> { |
| 212 | const weightPath = Array.isArray(this.path) ? this.path[1] : this.path; |
| 213 | const [prefix, suffix] = parseUrl(weightPath); |
| 214 | const pathPrefix = this.weightPathPrefix || prefix; |
| 215 | |
| 216 | const fetchURLs: string[] = []; |
| 217 | const urlPromises: Array<Promise<string>> = []; |
| 218 | for (const weightsGroup of weightsManifest) { |
| 219 | for (const path of weightsGroup.paths) { |
| 220 | if (this.weightUrlConverter != null) { |
| 221 | urlPromises.push(this.weightUrlConverter(path)); |
| 222 | } else { |
| 223 | fetchURLs.push(pathPrefix + path + suffix); |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | if (this.weightUrlConverter) { |
| 229 | fetchURLs.push(...await Promise.all(urlPromises)); |
| 230 | } |
| 231 | return fetchURLs; |
| 232 | } |
| 233 | |
| 234 | private async loadWeights(weightsManifest: WeightsManifestConfig): |
| 235 | Promise<[WeightsManifestEntry[], WeightData]> { |
no test coverage detected