InternLM / InternLM/lmdeploy

[Docs] got an unexpected keyword argument 'enable_lora'

Open
#1,151 2 comments 0 reactions 1 assignee Claimed by @grimoire View on GitHub
Dominant language
Python
Stars
8.1k
Forks
748
Avg merge
6d 2h
Merged PRs (30d)
54

Description

### 📚 The doc issue

```python
from lmdeploy.messages import PytorchEngineConfig
from lmdeploy.pytorch.engine.engine import Engine
adapters = {'adapter0':'/root/.cache/huggingface/hub/models--tloen--alpaca-lora-7b/snapshots/12103d6baae1b320aa60631b38acb6ea094a0539/'}
engine_config = PytorchEngineConfig(adapters=adapters)

model_path = '/data/weilong.yu/lmdeploy/llama-7b'
engine = Engine.from_pretrained(model_path,
engine_config=engine_config,
trust_remote_code=True)
generator = engine.create_instance()
session_id = 0
input_ids = [0,1,2,3]*10

cnt = 0

for outputs in generator.stream_infer(session_id=session_id,
input_ids=input_ids,
adapter_name='adapter0'):
cnt += 1
if cnt == 2:
break
print(outputs)
print('finish')
# close session and release caches
generator.end(session_id)
```

这是我之前运行 s-lora,代码里下载的 adapter 的配置文件
```
{
"base_model_name_or_path": "decapoda-research/llama-7b-hf",
"bias": "none",
"enable_lora": null,
"fan_in_fan_out": false,
"inference_mode": true,
"lora_alpha": 16,
"lora_dropout": 0.05,
"merge_weights": false,
"modules_to_save": null,
"peft_type": "LORA",
"r": 16,
"target_modules": [
"q_proj",
"k_proj",
"v_proj",
"o_proj"
],
"task_type": "CAUSAL_LM"
}
```

是这个下载文件的格式问题 还是 lmdeploy 的兼容问题?

### Suggest a potential alternative/fix

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.