fetch-wechat
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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()});

Dependencies (0)

    Dev Dependencies (25)

    Package Sidebar

    Install

    npm i fetch-wechat

    Weekly Downloads

    9

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    763 kB

    Total Files

    21

    Last publish

    Collaborators

    • pyu10055