Skip to content
New issue

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

How to use fp16 version of the model file? #676

Closed
cyio opened this issue Apr 2, 2024 · 2 comments
Closed

How to use fp16 version of the model file? #676

cyio opened this issue Apr 2, 2024 · 2 comments
Labels
question Further information is requested

Comments

@cyio
Copy link

cyio commented Apr 2, 2024

Question

example files: https://huggingface.co/Xenova/modnet/tree/main/onnx

@cyio cyio added the question Further information is requested label Apr 2, 2024
@xenova
Copy link
Collaborator

xenova commented Apr 2, 2024

This requires the experimental v3 branch: #545
where you can specify dtype:

import { pipeline } from '@xenova/transformers';

// Create feature extraction pipeline
const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', {
    // device: 'webgpu', (Optional)
    dtype: 'fp32', // or 'fp16'
});

@cyio
Copy link
Author

cyio commented Apr 3, 2024

step:

  1. npm install xenova/transformers.js#v3
  2. for vite project, resolve Top await error with vite build error -- Transform failed with 3 errors - Top-level await is not available in the configured target environment remix-run/remix#7969 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants