We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用transformer.js加载模型会向hugging face发送请求,如果用hf-mirror的话,就需要在响应头中包含 Access-Control-Allow-Origin:*
Access-Control-Allow-Origin:*
The text was updated successfully, but these errors were encountered:
问个问题,huggingface.co 支持跨域吗?另外有最小的代码sample和测试方法用于测试是否支持跨域吗,我修改后方便测试
Sorry, something went wrong.
import { pipeline, env as tFenv } from "https://gcore.jsdelivr.net/npm/@xenova/transformers@2.6.0"; tFenv.remoteHost = 'https://hf-mirror.com'; //此处默认值为https://huggingface.co,是支持跨域的 const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en'); const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav'; const output = await transcriber(url); console.log(output); //不出意外的话这里会输出一个带有text的json
No branches or pull requests
使用transformer.js加载模型会向hugging face发送请求,如果用hf-mirror的话,就需要在响应头中包含
Access-Control-Allow-Origin:*
The text was updated successfully, but these errors were encountered: