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

Not able to run 'Generate' from QuickStart section #61

Open
harikrishnaapc opened this issue Jan 3, 2024 · 0 comments
Open

Not able to run 'Generate' from QuickStart section #61

harikrishnaapc opened this issue Jan 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@harikrishnaapc
Copy link

Hi,

I have docker pull huggingface/optimum-nvidia and
then started docker container by docker run -it --rm --gpus all -v /path/to/my_model:/my_model huggingface/optimum-nvidia
I have ran llama.py from example folder once and generated build.json and copied that to my model folder as well.

I have created one more file python file inside docker with 'Generate' section of 'Quickstart Guide' as contents, while running that im getting,

Traceback (most recent call last):
  File "/opt/optimum-nvidia/examples/text-generation/tst.py", line 26, in <module>
    tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 3710, in batch_decode
    return [
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 3711, in <listcomp>
    self.decode(
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 3750, in decode
    return self._decode(
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_fast.py", line 626, in _decode
    text = self._tokenizer.decode(token_ids, skip_special_tokens=skip_special_tokens)
TypeError: argument 'ids': 'list' object cannot be interpreted as an integer

upon checking the 'token_ids' in the above line is a list(list(list(Int))) e.g [[[1,2]]]
while self._tokenizer.decode(token_ids[0][0], skip_special_tokens=skip_special_tokens) is working. Can you please check this or am i doing anything wrong?

Also getting errors when passing multiple prompts.

@mfuntowicz mfuntowicz added the bug Something isn't working label Jan 15, 2024
@mfuntowicz mfuntowicz self-assigned this Jan 15, 2024
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

2 participants