-
Notifications
You must be signed in to change notification settings - Fork 29
Description
(animegamer) root@job-3932-1733411462-mc6rb:/data/try/AnimeGamer# python inference_MLLM.py
[2025-04-07 15:05:32,829] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Loading checkpoint shards: 100%|████████████████████| 2/2 [00:02<00:00, 1.49s/it]
old vocab size: 32000, new vocab size: 32284
Length of tokenizer and resize embedding: 32284
peft config: LoraConfig(task_type='CAUSAL_LM', peft_type=<PeftType.LORA: 'LORA'>, auto_mapping=None, base_model_name_or_path=None, revision=None, inference_mode=False, r=32, target_modules={'down_proj', 'k_proj', 'gate_proj', 'o_proj', 'v_proj', 'up_proj', 'q_proj'}, exclude_modules=None, lora_alpha=32, lora_dropout=0.05, fan_in_fan_out=False, bias='none', use_rslora=False, modules_to_save=['input_layernorm', 'post_attention_layernorm', 'norm'], init_lora_weights=True, layers_to_transform=None, layers_pattern=None, rank_pattern={}, alpha_pattern={}, megatron_config=None, megatron_core='megatron.core', trainable_token_indices=None, loftq_config={}, eva_config=None, corda_config=None, use_dora=False, layer_replication=None, runtime_config=LoraRuntimeConfig(ephemeral_gpu_offload=False), lora_bias=False)
trainable params: 348,622,848 || all params: 7,328,210,944 || trainable%: 4.7573
Init llm done.
/opt/conda/envs/animegamer/lib/python3.10/site-packages/timm/models/layers/init.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning)
Traceback (most recent call last):
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/utils.py", line 644, in _locate
obj = getattr(obj, part)
AttributeError: module 'MLLM.src.models' has no attribute 'discrete_models'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/utils.py", line 650, in _locate
obj = import_module(mod)
File "/opt/conda/envs/animegamer/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/data/try/AnimeGamer/MLLM/src/models/discrete_models.py", line 9, in
pyrootutils.setup_root(file, indicator='.project-root', pythonpath=True)
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/pyrootutils/pyrootutils.py", line 151, in setup_root
path = find_root(search_from, indicator)
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/pyrootutils/pyrootutils.py", line 73, in find_root
raise FileNotFoundError(f"Project root directory not found. Indicators: {indicator}")
FileNotFoundError: Project root directory not found. Indicators: ['.project-root']
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 134, in _resolve_target
target = _locate(target)
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/utils.py", line 658, in _locate
raise ImportError(
ImportError: Error loading 'MLLM.src.models.discrete_models.ProjectionLayer':
FileNotFoundError("Project root directory not found. Indicators: ['.project-root']")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/try/AnimeGamer/inference_MLLM.py", line 84, in
agent_model = hydra.utils.instantiate(agent_model_cfg, llm=llm)
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 226, in instantiate
return instantiate_node(
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 342, in instantiate_node
value = instantiate_node(
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 333, in instantiate_node
target = _resolve_target(node.get(_Keys.TARGET), full_key)
File "/opt/conda/envs/animegamer/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 139, in _resolve_target
raise InstantiationException(msg) from e
hydra.errors.InstantiationException: Error locating target 'MLLM.src.models.discrete_models.ProjectionLayer', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: input_resampler
严格按照readme流程做的,请问如何修改