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

Mac 'str' object has no attribute 'sequences #126

Open
gr3enarr0w opened this issue Apr 24, 2024 · 0 comments
Open

Mac 'str' object has no attribute 'sequences #126

gr3enarr0w opened this issue Apr 24, 2024 · 0 comments

Comments

@gr3enarr0w
Copy link

from airllm import AutoModel

model = AutoModel.from_pretrained("v2ray/Llama-3-70B")

input_text = [
        #'What is the capital of United States?',
        'I like',
    ]

MAX_LENGTH = 128
input_tokens = model.tokenizer(input_text,
    return_tensors="np",
    return_attention_mask=False,
    truncation=True,
    max_length=MAX_LENGTH,
    padding=False)

input_tokens

generation_output = model.generate(
    mx.array(input_tokens['input_ids']),
    max_new_tokens=20,
    use_cache=True,
    return_dict_in_generate=True)

output = model.tokenizer.decode(generation_output.sequences[0])
print(output)```


Get Error
```Traceback (most recent call last):
  File "/Users/clarkeverson/llama_test/pythonProject/llama-play.py", line 27, in <module>
    output = model.tokenizer.decode(generation_output.sequences[0])
AttributeError: 'str' object has no attribute 'sequences'```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant