@mineproness/tensorloop 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/GetConfigs.js +10 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mineproness/tensorloop",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "The most powerfull Machine Learning Library for AI.",
5
5
  "keywords": [
6
6
  "ai",
package/src/GetConfigs.js CHANGED
@@ -1,13 +1,16 @@
1
1
  import fs from "fs";
2
2
  import { join } from "path";
3
3
 
4
- export function SaveVectors (filename, vectors){
5
- const sizeOfArray = vectors.length;
6
- const sizeOfEmbedding = vectors[0].length;
7
- const floatArray = vectors.map((e)=> Buffer.from(e.buffer))
8
- const combinedBuffer = Buffer.concat(floatArray)
9
- fs.writeFileSync(filename , combinedBuffer)
10
-
4
+ export function SaveVectors(filename, vectors) {
5
+ const fd = fs.openSync(filename, "w");
6
+
7
+ try {
8
+ for (const vector of vectors) {
9
+ fs.writeSync(fd, Buffer.from(vector.buffer));
10
+ }
11
+ } finally {
12
+ fs.closeSync(fd);
13
+ }
11
14
  }
12
15
 
13
16
  export function GetVectors(filename, embeddingSize){