hf-hub icon indicating copy to clipboard operation
hf-hub copied to clipboard

Wasm support

Open swfsql opened this issue 1 year ago • 0 comments

Hello, it would be nice if there was a wasm support on the library (or a wasm port of it).

I'm aware that many dependencies would not be compatible, nor the workflow itself (creating directories, indicating progress, etc). Also, I can't say there would be a lot of demand for this feature (I myself just want to experiment with some wasm).

For one thing, there are a few options for storage cache for a wasm app:

  • IndexedDB could work well, with indexed_db_futures being an option.
  • Cache storage is being used by the candle wasm examples, which could also work, but being limited to request-responses I think would be a different design from how hf-hub behaves.
  • Origin private fs could be the most relatable option, but I don't think there are good rust wrapping libraries for this.

I've started a drafty wasm port, and if it works reasonably well I'll attach a PR. Thanks!

swfsql avatar Feb 12 '24 04:02 swfsql