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

BUG: Fail to run model "bge-reranker-v2-minicpm-layerwise" with Xinference v0.11.0 version (docker images) #1515

Closed
majestichou opened this issue May 17, 2024 · 8 comments · Fixed by #1538
Labels
bug Something isn't working
Milestone

Comments

@majestichou
Copy link

majestichou commented May 17, 2024

Describe the bug

I downloaded the "bge-reranker-v2-minicpm-layerwise" model weights to the server and registered this model (the registered model name is "bge-reranker-v2-minicpm-layerwise-self") with Xinference v0.11.0 version (docker images). Then I launched this model. However, it crushed. The error information is as follows:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/xinference/api/restful_api.py", line 697, in launch_model
    model_uid = await (await self._get_supervisor_ref()).launch_builtin_model(
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/context.py", line 227, in send
    return self._process_result_message(result)
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/context.py", line 102, in _process_result_message
    raise message.as_instanceof_cause()
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/pool.py", line 659, in send
    result = await self._run_coro(message.message_id, coro)
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/pool.py", line 370, in _run_coro
    return await coro
  File "/opt/conda/lib/python3.10/site-packages/xoscar/api.py", line 384, in __on_receive__
    return await super().__on_receive__(message)  # type: ignore
  File "xoscar/core.pyx", line 558, in __on_receive__
    raise ex
  File "xoscar/core.pyx", line 520, in xoscar.core._BaseActor.__on_receive__
    async with self._lock:
  File "xoscar/core.pyx", line 521, in xoscar.core._BaseActor.__on_receive__
    with debug_async_timeout('actor_lock_timeout',
  File "xoscar/core.pyx", line 526, in xoscar.core._BaseActor.__on_receive__
    result = await result
  File "/opt/conda/lib/python3.10/site-packages/xinference/core/supervisor.py", line 836, in launch_builtin_model
    await _launch_model()
  File "/opt/conda/lib/python3.10/site-packages/xinference/core/supervisor.py", line 800, in _launch_model
    await _launch_one_model(rep_model_uid)
  File "/opt/conda/lib/python3.10/site-packages/xinference/core/supervisor.py", line 781, in _launch_one_model
    await worker_ref.launch_builtin_model(
  File "xoscar/core.pyx", line 284, in __pyx_actor_method_wrapper
    async with lock:
  File "xoscar/core.pyx", line 287, in xoscar.core.__pyx_actor_method_wrapper
    result = await result
  File "/opt/conda/lib/python3.10/site-packages/xinference/core/utils.py", line 45, in wrapped
    ret = await func(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/xinference/core/worker.py", line 659, in launch_builtin_model
    await model_ref.load()
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/context.py", line 227, in send
    return self._process_result_message(result)
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/context.py", line 102, in _process_result_message
    raise message.as_instanceof_cause()
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/pool.py", line 659, in send
    result = await self._run_coro(message.message_id, coro)
  File "/opt/conda/lib/python3.10/site-packages/xoscar/backends/pool.py", line 370, in _run_coro
    return await coro
  File "/opt/conda/lib/python3.10/site-packages/xoscar/api.py", line 384, in __on_receive__
    return await super().__on_receive__(message)  # type: ignore
  File "xoscar/core.pyx", line 558, in __on_receive__
    raise ex
  File "xoscar/core.pyx", line 520, in xoscar.core._BaseActor.__on_receive__
    async with self._lock:
  File "xoscar/core.pyx", line 521, in xoscar.core._BaseActor.__on_receive__
    with debug_async_timeout('actor_lock_timeout',
  File "xoscar/core.pyx", line 524, in xoscar.core._BaseActor.__on_receive__
    result = func(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/xinference/core/model.py", line 239, in load
    self._model.load()
  File "/opt/conda/lib/python3.10/site-packages/xinference/model/rerank/core.py", line 134, in load
    self._model = CrossEncoder(
  File "/opt/conda/lib/python3.10/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py", line 66, in __init__
    self.config = AutoConfig.from_pretrained(model_name, trust_remote_code=trust_remote_code, revision=revision)
  File "/opt/conda/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 931, in from_pretrained
    trust_remote_code = resolve_trust_remote_code(
  File "/opt/conda/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 627, in resolve_trust_remote_code
    raise ValueError(
ValueError: [address=0.0.0.0:40830, pid=186] Loading /root/.xinference/cache/bge-reranker-v2-minicpm-layerwise-self requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option `trust_remote_code=True` to remove this error.

To Reproduce

  1. Download Xinference v0.11.0 version (docker images).
  2. Downloaded the "bge-reranker-v2-gemma" model weights to the server and register this model (the registered model name is "bge-reranker-v2-minicpm-layerwise-self") with Xinference v0.11.0 version (docker images). Then launch this model.

Expected behavior

No crush. According the Xinference docs (https://inference.readthedocs.io/en/latest/models/builtin/rerank/bge-reranker-v2-minicpm-layerwise.html), bge-reranker-v2-minicpm-layerwise model is supported.

@XprobeBot XprobeBot added the bug Something isn't working label May 17, 2024
@XprobeBot XprobeBot modified the milestones: v0.11.1, v0.11.2 May 17, 2024
@majestichou majestichou changed the title BUG: Fail to run model "bge-reranker-v2-gemma" with the latest Xinference v0.11.0 version (docker images) BUG: Fail to run model "bge-reranker-v2-minicpm-layerwise" with the latest Xinference v0.11.0 version (docker images) May 17, 2024
@majestichou majestichou changed the title BUG: Fail to run model "bge-reranker-v2-minicpm-layerwise" with the latest Xinference v0.11.0 version (docker images) BUG: Fail to run model "bge-reranker-v2-minicpm-layerwise" with Xinference v0.11.0 version (docker images) May 17, 2024
@qinxuye
Copy link
Contributor

qinxuye commented May 21, 2024

@codingl2k1 can you give a help?

@codingl2k1
Copy link
Contributor

@codingl2k1 can you give a help?

I am looking into this issue.

@codingl2k1
Copy link
Contributor

This model works well on my Mac, and I can run the rerank benchmark on it, though it's very slow.

Name: FlagEmbedding
Version: 1.2.8

Name: transformers
Version: 4.39.1

@majestichou
Copy link
Author

This model works well on my Mac, and I can run the rerank benchmark on it, though it's very slow.

Name: FlagEmbedding Version: 1.2.8

Name: transformers Version: 4.39.1

Which version of Xinference docker image did you use?

@majestichou
Copy link
Author

This model works well on my Mac, and I can run the rerank benchmark on it, though it's very slow.

Name: FlagEmbedding Version: 1.2.8

Name: transformers Version: 4.39.1

Can you try to repeat my steps below?
I downloaded the "bge-reranker-v2-minicpm-layerwise" model weights to the server and registered this model (the registered model name is "bge-reranker-v2-minicpm-layerwise-self") with Xinference v0.11.1 version (docker images). Then I launched this model. However, it crushed. The error information is as follows:
Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True to remove this error.

@codingl2k1
Copy link
Contributor

This model works well on my Mac, and I can run the rerank benchmark on it, though it's very slow.
Name: FlagEmbedding Version: 1.2.8
Name: transformers Version: 4.39.1

Can you try to repeat my steps below? I downloaded the "bge-reranker-v2-minicpm-layerwise" model weights to the server and registered this model (the registered model name is "bge-reranker-v2-minicpm-layerwise-self") with Xinference v0.11.1 version (docker images). Then I launched this model. However, it crushed. The error information is as follows: Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True to remove this error.

I will try your steps.

@codingl2k1
Copy link
Contributor

How do you register the model bge-reranker-v2-minicpm-layerwise-self? The model spec's type should be LLM-based layerwise. From your traceback, the callstack was in type == "normal".

image

@majestichou
Copy link
Author

How do you register the model bge-reranker-v2-minicpm-layerwise-self? The model spec's type should be LLM-based layerwise. From your traceback, the callstack was in type == "normal".

image

I choose Register Model Tab,select "RERANK MODEL",fill in the parameters: model name and model path in docker container and choose English and Chinese. Finally,register.

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

Successfully merging a pull request may close this issue.

4 participants