Open wujohns opened 11 months ago
Hi there 👋 You can update the remote host and path template used:
import { env } from '@xenova/transformers';
env.remoteHost = 'https://example.com/'; // defaults to 'https://huggingface.co/'
env.remotePathTemplate = '{model}/'; // defaults to '{model}/resolve/{revision}/'
// continue normally
For remotePathTemplate, {model}
will be replaced by the model_id (e.g., Xenova/bert-base-cased
) and {revision}
will be replaced with the revision used (defaults to 'main'
).
Using the above example, when requesting Xenova/bert-base-cased
, the request will be made to https://example.com/Xenova/bert-base-cased/
Because of the network reason, when using transfomer.js we cannot download the model successful How to set the network proxy for the model download