Skip to content

Can't use large models with pipeline() #1179

@sroussey

Description

@sroussey

System Info

Example:

        const p = pipeline('text-generation', 'Xenova/Phi-3-mini-4k-instruct', {
            device: 'webgpu',
            dtype: 'q4',
        });

I see this error in the console:

Uncaught (in promise) Error: Can't create a session. ERROR_CODE: 1, ERROR_MESSAGE: Deserialize tensor model.layers.5.mlp.gate_proj.MatMul.weight_Q4 failed.Failed to load external data file ""model_q4.onnx_data"", error: Module.MountedFiles is not available.

Seeing that onnx_data is the issue, I figured I needed to pass use_external_data_format along, but it does not work.

I have tried :

        const p = pipeline('text-generation', 'Xenova/Phi-3-mini-4k-instruct', {
            device: 'webgpu',
            dtype: 'q4',
            use_external_data_format: true,
        });

and

        const p = pipeline('text-generation', 'Xenova/Phi-3-mini-4k-instruct', {
            device: 'webgpu',
            dtype: 'q4',
            session_options: {use_external_data_format: true},
        });

But neither of these will load the model correctly.

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

see above

Reproduction

see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions