You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use outlines to generate json objects based on a Pydantic model.
I am loading my model on a GPU, but when I try to generate an object, I get an error saying that pytorch also found tensors on the CPU.
Traceback (most recent call last):
File "/my_example.py", line ..., in<module>
outlines_output = generator("test prompt", rng=rng)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib/python3.11/site-packages/outlines/generate/api.py", line 205, in __call__
last_state = next(states)
^^^^^^^^^^^^
File "lib/python3.11/site-packages/outlines/generate/generator.py", line 83, in sequence_generator
token_ids = update_token_ids(token_ids, next_token_ids, ancestors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "lib/python3.11/site-packages/outlines/generate/generator.py", line 198, in update_token_ids
token_ids = torch.index_select(token_ids, 0, ancestors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument forargument indexin method wrapper_CUDA__index_select)
Describe the issue as clearly as possible:
I'm trying to use outlines to generate json objects based on a Pydantic model.
I am loading my model on a GPU, but when I try to generate an object, I get an error saying that pytorch also found tensors on the CPU.
Steps/code to reproduce the bug:
Expected result:
Error message:
Outlines/Python version information:
Context for the issue:
This used to work in version 0.0.27, I think this might be related to 3391fa4
The text was updated successfully, but these errors were encountered: