icbsc-fetch.js
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

skip arraybuffer support

fetch-wechat

Fetch polyfill for WeChat mini program platform to work with TensorFlow.js.

TensorFlow.js allow you to load models served by HTTPs server. There are two model loading APIs

  • tf.loadGraphModel
  • tf.loadLayerModel

Both of which requires a fetch API exposed on the global scope or provided as part of the loadOption field.

The library is essentially a wrapper of wx.request API that simulates the fetch API. This is inspired by wxapp-fetch, with simpler code base and support of arraybuffer function.

Code example:

import { fetchFunc } from 'wechat_fetch';

const model = await tf.loadGraphModel(
      'https://model.url.com/model.json', {fetchFunc: fetchFunc()});

Readme

Keywords

none

Package Sidebar

Install

npm i icbsc-fetch.js

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

764 kB

Total Files

21

Last publish

Collaborators

  • sandmanhome