-
Notifications
You must be signed in to change notification settings - Fork 4
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
Why it changes pytorch version #5
Comments
Also it is slower than the default, here is one example: `from turbot5 import T5ForConditionalGeneration, T5Config Initialize the tokenizer and modeltokenizer = T5Tokenizer.from_pretrained("google-t5/t5-large") # Use smaller model Enable mixed precisionscaler = torch.cuda.amp.GradScaler() List of input sentences for translationinput_texts = [ Tokenize the input sentences (process smaller batches if needed)input_ids = tokenizer(input_texts, return_tensors="pt", padding=True, truncation=True).input_ids.to('cuda') Function to measure execution timedef measure_time(func): Number of repetitionsnum_repetitions = 5 Loop to repeat the translation process 5 timesfor i in range(num_repetitions):
Calculate and print the average execution timeaverage_time = total_time / num_repetitions |
Whu it changes pytorch version and installs different cuda on the system?
This would break most peoples's environments actually, because there can be only one cuda version on the Ubuntu, and it has to match the one in the environment.
The text was updated successfully, but these errors were encountered: