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

Anomalous T5 results using GPU inference on a 4090 graphics card #1679

Open
taishan1994 opened this issue Apr 25, 2024 · 3 comments
Open

Anomalous T5 results using GPU inference on a 4090 graphics card #1679

taishan1994 opened this issue Apr 25, 2024 · 3 comments

Comments

@taishan1994
Copy link

Thank you very much for your work. I'm using ctranslate2 accelerated https://huggingface.co/Maciel/T5Corrector-base-v2 reasoning and when using the cpu for inference the output is normal, but switching to using the GPU, the output is all: Response Text: {" translated_text":"..."} , where is the problem please?

@BBC-Esq
Copy link

BBC-Esq commented Apr 25, 2024

Wish I could help but it's all in Chinese...what exactly are you trying to do?

@taishan1994
Copy link
Author

This is the code I tested.

ct2-transformers-converter --model T5Corrector-base-v2 --output_dir T5Corrector-base-v2-ct2  --force --quantization float16

import ctranslate2
# translator = ctranslate2.Translator("T5Corrector-base-v2-ct2", device="cpu")
translator = ctranslate2.Translator("T5Corrector-base-v2-ct2", device="cuda",  device_index=0)
input_text=""
input_tokens = tokenizer.convert_ids_to_tokens(tokenizer.encode(input_text))
results = translator.translate_batch([input_tokens])

output_tokens = results[0].hypotheses[0]
output_text = tokenizer.decode(tokenizer.convert_tokens_to_ids(output_tokens))

@BBC-Esq
Copy link

BBC-Esq commented Apr 26, 2024

Sorry, thought I might help but not familiar with that model.

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

2 participants