Open charliboy opened 2 weeks ago
same, launch model:ImportError: cannot import name 'wraps' from partially initialized module 'functools' (most likely due to a circular import)
我升级到0.12.3版本,运行时仍然会报错:
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
2024-07-05 08:59:06,682 xinference.core.worker 1136015 ERROR Failed to load model qwen2-moe-instruct-1-0
Traceback (most recent call last):
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/worker.py", line 673, in launch_builtin_model
await model_ref.load()
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/context.py", line 227, in send
return self._process_result_message(result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/context.py", line 102, in _process_result_message
raise message.as_instanceof_cause()
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/pool.py", line 659, in send
result = await self._run_coro(message.message_id, coro)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/pool.py", line 370, in _run_coro
return await coro
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/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 "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/model.py", line 278, in load
self._model.load()
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/model/llm/vllm/core.py", line 230, in load
self._engine = AsyncLLMEngine.from_engine_args(engine_args)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 386, in from_engine_args
engine = cls(
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 340, in init
self.engine = self._init_engine(*args, kwargs)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/engine/async_llm_engine.py", line 462, in _init_engine
return engine_class(*args, *kwargs)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/engine/llm_engine.py", line 222, in init
self.model_executor = executor_class(
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 41, in init
self._init_executor()
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/executor/gpu_executor.py", line 24, in _init_executor
self.driver_worker.load_model()
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/worker/worker.py", line 121, in load_model
self.model_runner.load_model()
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/worker/model_runner.py", line 134, in load_model
self.model = get_model(
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/model_executor/model_loader/init.py", line 21, in get_model
return loader.load_model(model_config=model_config,
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 240, in load_model
model = _initialize_model(model_config, self.load_config,
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 91, in _initialize_model
return model_class(config=model_config.hf_config,
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/model_executor/models/qwen2_moe.py", line 389, in init
self.model = Qwen2MoeModel(config, cache_config, quant_config)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/model_executor/models/qwen2_moe.py", line 349, in init
self.layers = nn.ModuleList([
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/vllm/model_executor/models/qwen2_moe.py", line 350, in
无法加载模型,后台报错:
1.当前版本为PYTHON 3.11.9,之前试过PYTHON3.10.X也报错
xinference . 0.12.2
pip install "xinference[all]" 安装后本地环境运行
Full stack of the error. Traceback (most recent call last): File "", line 1, in
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/init.py", line 16, in
from . import context
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/context.py", line 3, in
import threading
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/threading.py", line 6, in
import functools
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/functools.py", line 22, in
from types import GenericAlias
File "/home/szh/vs/gpt/inference/xinference/types.py", line 15, in
from typing import Any, Callable, Dict, ForwardRef, Iterable, List, Optional, Union
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/typing.py", line 26, in
import contextlib
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/contextlib.py", line 7, in
from functools import wraps
ImportError: cannot import name 'wraps' from partially initialized module 'functools' (most likely due to a circular import) (/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/functools.py)
Traceback (most recent call last):
File "", line 1, in
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/init.py", line 16, in
from . import context
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/context.py", line 3, in
import threading
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/threading.py", line 6, in
import functools
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/functools.py", line 22, in
from types import GenericAlias
File "/home/szh/vs/gpt/inference/xinference/types.py", line 15, in
from typing import Any, Callable, Dict, ForwardRef, Iterable, List, Optional, Union
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/typing.py", line 26, in
import contextlib
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/contextlib.py", line 7, in
from functools import wraps
ImportError: cannot import name 'wraps' from partially initialized module 'functools' (most likely due to a circular import) (/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/functools.py)
2024-06-21 16:15:33,671 xinference.api.restful_api 496257 ERROR [address=0.0.0.0:33638, pid=496341] unexpected EOF
Traceback (most recent call last):
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/api/restful_api.py", line 770, in launch_model
model_uid = await (await self._get_supervisor_ref()).launch_builtin_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/context.py", line 227, in send
return self._process_result_message(result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/context.py", line 102, in _process_result_message
raise message.as_instanceof_cause()
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/pool.py", line 659, in send
result = await self._run_coro(message.message_id, coro)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/pool.py", line 370, in _run_coro
return await coro
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/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 "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/supervisor.py", line 837, in launch_builtin_model
await _launch_model()
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/supervisor.py", line 801, in _launch_model
await _launch_one_model(rep_model_uid)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/supervisor.py", line 782, 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 "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/utils.py", line 45, in wrapped
ret = await func(*args, *kwargs)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/worker.py", line 635, in launch_builtin_model
subpool_address, devices = await self._create_subpool(
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xinference/core/worker.py", line 493, in _create_subpool
subpool_address = await self._main_pool.append_sub_pool(
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/indigen/pool.py", line 382, in append_sub_pool
process, process_status = await create_pool_task
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/site-packages/xoscar/backends/indigen/pool.py", line 373, in start_pool_in_process
process.start()
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/context.py", line 300, in _Popen
return Popen(process_obj)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/popen_forkserver.py", line 35, in init
super().init__(process_obj)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/popen_forkserver.py", line 59, in _launch
self.pid = forkserver.read_signed(self.sentinel)
^^^^^^^^^^^^^^^^^
File "/home/szh/vs/gpt/text-generation-webui/installer_files/conda/envs/inference/lib/python3.11/multiprocessing/forkserver.py", line 328, in read_signed
raise EOFError('unexpected EOF')
conda 环境 ubuntu22.04上本地运行