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

执行构建agent代码的时候报错如下:Qwen2TokenizerFast has no attribute "get _token_id" . Did you mean:"sep_token_id" #712

Open
6 tasks done
qxevtnuko opened this issue Dec 7, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@qxevtnuko
Copy link

Self Checks

  • This template is only for bug reports. For questions, please visit Discussions.
  • I have thoroughly reviewed the project documentation (installation, training, inference) but couldn't find information to solve my problem. English 中文 日本語 Portuguese (Brazil)
  • I have searched for existing issues, including closed ones. Search issues
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template and fill in all required fields.

Cloud or Self Hosted

Self Hosted (Source)

Environment Details

python 3.10 fish-speech-1.5 windows

Steps to Reproduce

When I python -m tools.api --llama-checkpoint-path checkpoints/fish-agent-v0.1-3b/ --mode agent --compile ,
AttributeError: Qwen2TokenizerFast has no attribute "get _token_id" . Did you mean:"sep_token_id"

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

@qxevtnuko qxevtnuko added the bug Something isn't working label Dec 7, 2024
@bellkjtt
Copy link

bellkjtt commented Dec 7, 2024

same error occured.

@AnyaCoder
Copy link
Collaborator

先用1.4版本

@None1024Outlook
Copy link

Self Checks

  • This template is only for bug reports. For questions, please visit Discussions.
  • I have thoroughly reviewed the project documentation (installation, training, inference) but couldn't find information to solve my problem. English 中文 日本語 Portuguese (Brazil)
  • I have searched for existing issues, including closed ones. Search issues
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template and fill in all required fields.

Cloud or Self Hosted

Self Hosted (Source)

Environment Details

python 3.10 fish-speech-1.5 windows

Steps to Reproduce

When I python -m tools.api --llama-checkpoint-path checkpoints/fish-agent-v0.1-3b/ --mode agent --compile , AttributeError: Qwen2TokenizerFast has no attribute "get _token_id" . Did you mean:"sep_token_id"

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Please use version 1.4 of the code, or you can refer to version 1.4 to modify the fish_stpeech/tokenizer. py file

@zhouzhouwen
Copy link

Hello, fish-speech is an amazing library, and I truly appreciate your work. I have also encountered the same error with the latest version.

(fish-speech) root@3aac063e8786:/app/data/zhouwen/fish-speech# python -m tools.api_server --llama-checkpoint-path /app/data/zhouwen/fish-speech/checkpoints/fish-agent-v0.1-3b --mode agent --compile python -m tools.api_server --llama-checkpoint-path /app/data/zhouwen/fish-speech/checkpoints/fish-agent-v0.1-3b --mode agent --compile
INFO: Started server process [3919003]
INFO: Waiting for application startup.
Exception in thread Thread-1 (worker):
Traceback (most recent call last):
File "/app/data/zhouwen/Anaconda3/envs/fish-speech/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/app/data/zhouwen/Anaconda3/envs/fish-speech/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/app/data/zhouwen/fish-speech/tools/llama/generate.py", line 960, in worker
model, decode_one_token = load_model(
File "/app/data/zhouwen/fish-speech/tools/llama/generate.py", line 677, in load_model
model: Union[NaiveTransformer, DualARTransformer] = BaseTransformer.from_pretrained(
File "/app/data/zhouwen/fish-speech/fish_speech/models/text2semantic/llama.py", line 411, in from_pretrained
model = model_cls(config, tokenizer=tokenizer)
File "/app/data/zhouwen/fish-speech/fish_speech/models/text2semantic/llama.py", line 542, in init
super().init(config, init_weights=False, tokenizer=tokenizer)
File "/app/data/zhouwen/fish-speech/fish_speech/models/text2semantic/llama.py", line 176, in init
self.semantic_token_ids = [
File "/app/data/zhouwen/fish-speech/fish_speech/models/text2semantic/llama.py", line 177, in
tokenizer.get_token_id(SEMANTIC_TOKEN) for SEMANTIC_TOKEN in SEMANTIC_TOKENS
File "/app/data/zhouwen/Anaconda3/envs/fish-speech/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 1104, in getattr
raise AttributeError(f"{self.class.name} has no attribute {key}")
AttributeError: Qwen2TokenizerFast has no attribute get_token_id

Following your previous responses, I tried using version 1.4.0, but the error still persists.

(fish-speech) root@3aac063e8786:/app/data/zhouwen/fish-speech-1.4.0# python -m tools.api --llama-checkpoint-path /app/data/zhouwen/fish-speech-1.4.0/checkpoints/fish-agent-v0.1-3b --compile
2024-12-09 06:17:49.674 | INFO | main::403 - Loading Llama model...
Exception in thread Thread-1 (worker):
Traceback (most recent call last):
File "/app/data/zhouwen/Anaconda3/envs/fish-speech/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/app/data/zhouwen/Anaconda3/envs/fish-speech/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/app/data/zhouwen/fish-speech-1.4.0/tools/llama/generate.py", line 561, in worker
model, decode_one_token = load_model(
File "/app/data/zhouwen/fish-speech-1.4.0/tools/llama/generate.py", line 343, in load_model
model: Union[NaiveTransformer, DualARTransformer] = BaseTransformer.from_pretrained(
File "/app/data/zhouwen/fish-speech-1.4.0/fish_speech/models/text2semantic/llama.py", line 325, in from_pretrained
config = BaseModelArgs.from_pretrained(str(path))
File "/app/data/zhouwen/fish-speech-1.4.0/fish_speech/models/text2semantic/llama.py", line 87, in from_pretrained
return cls(**data)
TypeError: DualARModelArgs.init() got an unexpected keyword argument 'fast_attention_qkv_bias'

I look forward to your reply.

@AnyaCoder
Copy link
Collaborator

1.4.3

@zhouzhouwen
Copy link

Thank you so much!!! It works now.

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

No branches or pull requests

5 participants