Cannot generate text on GPU #199
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I load the model to GPU like this:
and generate code like this:
when I ran this code, the model got 6.6Gb on GPU. But I've got the exception: You are calling .generate() with the
input_idsbeing on a device type different than your model's device.input_idsis on cuda, whereas the model is on cpu. when ran generate method.Does anyone know the way to fix it?
What device is model_inputs on?
I use T4 on Google Colab.
Double check your code parts against the gold standard examples at: https://github.com/marella/ctransformers?tab=readme-ov-file#classmethod-automodelforcausallmfrom_pretrained
Do the same for the generate method of your llm class. Here is the gold standard reference for that as well: https://github.com/marella/ctransformers?tab=readme-ov-file#classmethod-automodelforcausallmfrom_pretrained
It looks like you have a lot of unnecessary arguments that you are mimicking from other libraries. Especially for the from_pretrained method call.
Hope that this helps.