Replies: 4 comments
-
I have the same problem running the stream.wasm on my local machine. |
Beta Was this translation helpful? Give feedback.
-
I have not done much coding for a few months now, but this like a very interesting project now. Getting it to run in a browser locally using .wasm could have some great applications. Are you still having issues with this ? Also, can the project otherwise run locally on an M1 MacBook Pro and also locally on an older iMac 2014 with an Intel Chip ? I occasionally communicate with some person in China who seems like a C++ NInja. Maybe he could help if he has not already contributed to this project. |
Beta Was this translation helpful? Give feedback.
-
Ok I just worked through this. I was using the "stream.wasm" example, but I think it applies to all the examples here. First, yeah, I had to download the model file locally. Just dropped it in the same directory I run my http server (I use python http.server). That avoids CORS issues (because the file and the server requesting it have the same origin). However, that doesn't fix a different error, which happens first: "Uncaught ReferenceError: SharedArrayBuffer is not defined at stream.js:1:11511". Stream.js is the file that contains all the compiled WASM code and initializes a bunch of emscripten stuff like "Module" and adds a bunch of methods to it, including "FS_createDataFile". Because the SharedArrayBuffer error happens first, it prevents all the other stuff in the script from loading, and you get the Module.FS_createDataFile error. The SharedArrayBuffer error is a security thing related to the Spectre vulnerability. Gerganov himself talks about it in another issue thread here. In any case, I fixed this by modifying my python http server to enable cross-origin isolation by adding a couple HTTP response headers to my local server. I dropped this in a python script and ran it instead of running import http.server
import socketserver
class CORSHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
super().end_headers()
if __name__ == '__main__':
PORT = 8000
with socketserver.TCPServer(("", PORT), CORSHTTPRequestHandler) as httpd:
print(f"Serving at port {PORT}")
httpd.serve_forever() Now everything works! Hope this helps, and happy to answer any follow-ups. |
Beta Was this translation helpful? Give feedback.
-
If anyone still got the |
Beta Was this translation helpful? Give feedback.
-
Was wondering if you guys could help with getting whisper.wasm working properly on my local browser.
Everything seems to work fine except when loading the model. When I select a model from my local machine I get the following error in the console:
(index):262 Uncaught TypeError: Module.FS_createDataFile is not a function
at storeFS ((index):262:24)
at reader.onload ((index):283:21)
When I select an audio file it seems to load fine and only cuts the first 120 seconds.
Any ideas on what the issue could be?
Beta Was this translation helpful? Give feedback.
All reactions