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

Unsupported model type: briaai/RMBG-2.0 #1107

Open
1 of 5 tasks
vlohar08 opened this issue Dec 22, 2024 · 0 comments
Open
1 of 5 tasks

Unsupported model type: briaai/RMBG-2.0 #1107

vlohar08 opened this issue Dec 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vlohar08
Copy link

vlohar08 commented Dec 22, 2024

System Info

Hi,
I have been building an app using the briaai/RMBG-2.0 model. Everything is working fine but I am getting one error.

Error: Unsupported model type: null

And, If I use a previous version of the model like briaai/RMBG-1.4
Error: Unsupported model type: SegformerForSemanticSegmentation

Model Initialization

state.model = await AutoModelForImageSegmentation.from_pretrained(MODEL_ID, {
      device: "auto",
      progress_callback: (progress: ProgressInfo) => {
        if (callback) {
          callback(progress);
        }
      },
});

Next Config

import type { NextConfig } from "next";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const nextConfig: NextConfig = {
  webpack: (config) => {
    config.resolve.alias["@huggingface/transformers"] = path.resolve(
      __dirname,
      "node_modules/@huggingface/transformers"
    );
    config.resolve.alias = {
      ...config.resolve.alias,
      sharp$: false,
      "onnxruntime-node$": false,
    };
    return config;
  },
};

export default nextConfig;

Packages
"@huggingface/transformers": "^3.2.1",
"next": "15.1.1",
"react": "^19.0.0",

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

The model is loaded correctly but not initialized.

Reproduction

Try to load model briaai/RMBG-2.0 in a Nextjs project on the client side.

@vlohar08 vlohar08 added the bug Something isn't working label Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant