Skip to content

[Question] React.js serve sentence bert in browser keep reporting models not found. #328

Closed
@bianyuanop

Description

@bianyuanop

my codes:

export const useInitTransformers = () => {
  const init = async () => {
    // @ts-ignore
    env.allowLocalModels = false;
    extractor = await pipeline(
      "feature-extraction",
      "Xenova/all-mpnet-base-v2",
    );
  };
  return { init };
};

I'm building a frontend with React that can serve sentence bert directly in browser, but no idea why even i add the line
env.allowLocalModels = false
before pipeline loading the model. In the production environment, it's still trying to access model locally /models/..., but which will never exists in this usecase.

Is there any way i can bypass this check and directly pull the model from remote?

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions