anarchy-ai / anarchy-ai/LLM-VM

Fix Llama2 implementation: Cannot import name 'Llama2Tokenizer' from 'transformers'

未关闭
#158 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feat/enhancement
主要语言
Python
星标
490
派生
139
PR 合并指标
30 天内没有已合并 PR

描述

I created a quickstart test file which is mainly doing the same that appears on the documentation:
```python
from llm_vm.client import Client

client = Client(
big_model = 'neo',
big_model_config={'model_uri':'EleutherAI/gpt-neo-1.3B'},
small_model ='neo',
small_model_config={'model_uri':'EleutherAI/gpt-neo-125m'})

response=client.complete(prompt='What is Anarchy?', context='')
print(response)
```

But when I try to run it return it the next error:
```
python quickstart-test.py
Traceback (most recent call last):
File ".../LLM-VM/quickstart-test.py", line 2, in
from llm_vm.client import Client
File ".../LLM-VM/src/llm_vm/client.py", line 3, in
import llm_vm.onsite_llm as llms
File ".../LLM-VM/src/llm_vm/onsite_llm.py", line 6, in
from transformers import (
ImportError: cannot import name 'Llama2Tokenizer' from 'transformers' (.../LLM-VM/.venv/lib/python3.10/site-packages/transformers/__init__.py
```

If I checkout at commit 7a5877b6a everything works fine.

I checked the [huggingface transformers documentation and llama2 model is using the same transformer](https://huggingface.co/docs/transformers/model_doc/llama2) I also checked the [repo](https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/tokenization_llama.py) and there is no llama2 folder nor Llama2Tokenizer, Llama2ForCausalLM classes.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。