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

transformers<=4.21.2 causing install errors #24

Open
leegunwoo98 opened this issue Jun 1, 2024 · 3 comments
Open

transformers<=4.21.2 causing install errors #24

leegunwoo98 opened this issue Jun 1, 2024 · 3 comments

Comments

@leegunwoo98
Copy link

the requirements for transformers<=4.21.2 is causing errors during compilation as it includes tokenizers>=0.11.1,!=0.11.3,<0.13. This causes the following error
warning: variable does not need to be mutable
--> tokenizers-lib/src/models/unigram/model.rs:265:21
|
265 | let mut target_node = &mut best_path_ends_at[key_pos];
| ----^^^^^^^^^^^
| |
| help: remove this mut
|
= note: #[warn(unused_mut)] on by default

  warning: variable does not need to be mutable
     --> tokenizers-lib/src/models/unigram/model.rs:282:21
      |
  282 |                 let mut target_node = &mut best_path_ends_at[starts_at + mblen];
      |                     ----^^^^^^^^^^^
      |                     |
      |                     help: remove this `mut`
  
  warning: variable does not need to be mutable
     --> tokenizers-lib/src/pre_tokenizers/byte_level.rs:200:59
      |
  200 |     encoding.process_tokens_with_offsets_mut(|(i, (token, mut offsets))| {
      |                                                           ----^^^^^^^
      |                                                           |
      |                                                           help: remove this `mut`
  
  error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
     --> tokenizers-lib/src/models/bpe/trainer.rs:526:47
      |
  522 |                     let w = &words[*i] as *const _ as *mut _;
      |                             -------------------------------- casting happend here
  ...
  526 |                         let word: &mut Word = &mut (*w);
      |                                               ^^^^^^^^^
      |
      = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
      = note: `#[deny(invalid_reference_casting)]` on by default
  
  warning: `tokenizers` (lib) generated 3 warnings
  error: could not compile `tokenizers` (lib) due to 1 previous error; 3 warnings emitted
  
  This is due to a rust compilation error (dependent on rust version).
  In order to fix this, we might want to move to using a newer transformer version which doesn't have this error.
@leegunwoo98
Copy link
Author

https://github.com/huggingface/tokenizers/issues/1402

This is an issue related to this

@mvrozanti
Copy link

Any news on this?

@mvrozanti
Copy link

I just bumped the version and changed an import and it worked #26

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