|
|
@@ -142,7 +142,11 @@ safetensors.Tensor = class {
|
|
|
const size = obj.data_offsets[1] - obj.data_offsets[0];
|
|
|
position += obj.data_offsets[0];
|
|
|
stream.seek(position);
|
|
|
- this.values = stream.read(size);
|
|
|
+ this._data = stream.stream(size);
|
|
|
+ }
|
|
|
+
|
|
|
+ get values() {
|
|
|
+ return this._data instanceof Uint8Array ? this._data : this._data.peek();
|
|
|
}
|
|
|
};
|
|
|
|