1. 13 Nov, 2023 6 commits
    • Gift Sinthong's avatar
      [time series] Add PatchTST (#25927) · 2ac5b932
      Gift Sinthong authored
      
      
      * Initial commit of PatchTST model classes
      Co-authored-by: default avatarPhanwadee Sinthong <phsinthong@gmail.com>
      Co-authored-by: default avatarNam Nguyen <namctin@gmail.com>
      Co-authored-by: default avatarVijay Ekambaram <vijaykr.e@gmail.com>
      Co-authored-by: default avatarNgoc Diep Do <55230119+diepi@users.noreply.github.com>
      Co-authored-by: default avatarWesley Gifford <79663411+wgifford@users.noreply.github.com>
      
      * Add PatchTSTForPretraining
      
      * update to include classification
      Co-authored-by: default avatarPhanwadee Sinthong <phsinthong@gmail.com>
      Co-authored-by: default avatarNam Nguyen <namctin@gmail.com>
      Co-authored-by: default avatarVijay Ekambaram <vijaykr.e@gmail.com>
      Co-authored-by: default avatarNgoc Diep Do <55230119+diepi@users.noreply.github.com>
      Co-authored-by: default avatarWesley Gifford <79663411+wgifford@users.noreply.github.com>
      
      * clean up auto files
      
      * Add PatchTSTForPrediction
      
      * Fix relative import
      
      * Replace original PatchTSTEncoder with ChannelAttentionPatchTSTEncoder
      
      * temporary adding absolute path + add PatchTSTForForecasting class
      
      * Update base PatchTSTModel + Unittest
      
      * Update ForecastHead to use the config class
      
      * edit cv_random_masking, add mask to model output
      
      * Update configuration_patchtst.py
      
      * add masked_loss to the pretraining
      
      * add PatchEmbeddings
      
      * Update configuration_patchtst.py
      
      * edit loss which considers mask in the pretraining
      
      * remove patch_last option
      
      * Add commits from internal repo
      
      * Update ForecastHead
      
      * Add model weight initilization + unittest
      
      * Update PatchTST unittest to use local import
      
      * PatchTST integration tests for pretraining and prediction
      
      * Added PatchTSTForRegression + update unittest to include label generation
      
      * Revert unrelated model test file
      
      * Combine similar output classes
      
      * update PredictionHead
      
      * Update configuration_patchtst.py
      
      * Add Revin
      
      * small edit to PatchTSTModelOutputWithNoAttention
      
      * Update modeling_patchtst.py
      
      * Updating integration test for forecasting
      
      * Fix unittest after class structure changed
      
      * docstring updates
      
      * change input_size to num_input_channels
      
      * more formatting
      
      * Remove some unused params
      
      * Add a comment for pretrained models
      
      * add channel_attention option
      
      add channel_attention option and remove unused positional encoders.
      
      * Update PatchTST models to use HF's MultiHeadAttention module
      
      * Update paper + github urls
      
      * Fix hidden_state return value
      
      * Update integration test to use PatchTSTForForecasting
      
      * Adding dataclass decorator for model output classes
      
      * Run fixup script
      
      * Rename model repos for integration test
      
      * edit argument explanation
      
      * change individual option to shared_projection
      
      * style
      
      * Rename integration test + import cleanup
      
      * Fix outpu_hidden_states return value
      
      * removed unused mode
      
      * added std, mean and nops scaler
      
      * add initial distributional loss for predition
      
      * fix typo in docs
      
      * add generate function
      
      * formatting
      
      * add num_parallel_samples
      
      * Fix a typo
      
      * copy weighted_average function, edit PredictionHead
      
      * edit PredictionHead
      
      * add distribution head to forecasting
      
      * formatting
      
      * Add generate function for forecasting
      
      * Add generate function to prediction task
      
      * formatting
      
      * use argsort
      
      * add past_observed_mask ordering
      
      * fix arguments
      
      * docs
      
      * add back test_model_outputs_equivalence test
      
      * formatting
      
      * cleanup
      
      * formatting
      
      * use ACT2CLS
      
      * formatting
      
      * fix add_start_docstrings decorator
      
      * add distribution head and generate function to regression task
      
      add distribution head and generate function to regression task. Also made add PatchTSTForForecastingOutput,  PatchTSTForRegressionOutput.
      
      * add distribution head and generate function to regression task
      
      add distribution head and generate function to regression task. Also made add PatchTSTForForecastingOutput,  PatchTSTForRegressionOutput.
      
      * fix typos
      
      * add forecast_masking
      
      * fixed tests
      
      * use set_seed
      
      * fix doc test
      
      * formatting
      
      * Update docs/source/en/model_doc/patchtst.md
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * better var names
      
      * rename PatchTSTTranspose
      
      * fix argument names and docs string
      
      * remove compute_num_patches and unused class
      
      * remove assert
      
      * renamed to PatchTSTMasking
      
      * use num_labels for classification
      
      * use num_labels
      
      * use default num_labels from super class
      
      * move model_type after docstring
      
      * renamed PatchTSTForMaskPretraining
      
      * bs -> batch_size
      
      * more review fixes
      
      * use hidden_state
      
      * rename encoder layer and block class
      
      * remove commented seed_number
      
      * edit docstring
      
      * Add docstring
      
      * formatting
      
      * use past_observed_mask
      
      * doc suggestion
      
      * make fix-copies
      
      * use Args:
      
      * add docstring
      
      * add docstring
      
      * change some variable names and add PatchTST before some class names
      
      * formatting
      
      * fix argument types
      
      * fix tests
      
      * change x variable to patch_input
      
      * format
      
      * formatting
      
      * fix-copies
      
      * Update tests/models/patchtst/test_modeling_patchtst.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * move loss to forward
      
      * Update src/transformers/models/patchtst/modeling_patchtst.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/transformers/models/patchtst/modeling_patchtst.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/transformers/models/patchtst/modeling_patchtst.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/transformers/models/patchtst/modeling_patchtst.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Update src/transformers/models/patchtst/modeling_patchtst.py
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * formatting
      
      * fix a bug when pre_norm is set to True
      
      * output_hidden_states is set to False as default
      
      * set pre_norm=True as default
      
      * format docstring
      
      * format
      
      * output_hidden_states is None by default
      
      * add missing docs
      
      * better var names
      
      * docstring: remove default to False in output_hidden_states
      
      * change labels name to target_values in regression task
      
      * format
      
      * fix tests
      
      * change to forecast_mask_ratios and random_mask_ratio
      
      * change mask names
      
      * change future_values to target_values param in the prediction class
      
      * remove nn.Sequential and make PatchTSTBatchNorm class
      
      * black
      
      * fix argument name for prediction
      
      * add output_attentions option
      
      * add output_attentions to PatchTSTEncoder
      
      * formatting
      
      * Add attention output option to all classes
      
      * Remove PatchTSTEncoderBlock
      
      * create PatchTSTEmbedding class
      
      * use config in PatchTSTPatchify
      
      * Use config in PatchTSTMasking class
      
      * add channel_attn_weights
      
      * Add PatchTSTScaler class
      
      * add output_attentions arg to test function
      
      * format
      
      * Update doc with image patchtst.md
      
      * fix-copies
      
      * rename Forecast <-> Prediction
      
      * change name of a few parameters to match with PatchTSMixer.
      
      * Remove *ForForecasting class to match with other time series models.
      
      * make style
      
      * Remove PatchTSTForForecasting in the test
      
      * remove PatchTSTForForecastingOutput class
      
      * change test_forecast_head to test_prediction_head
      
      * style
      
      * fix docs
      
      * fix tests
      
      * change num_labels to num_targets
      
      * Remove PatchTSTTranspose
      
      * remove arguments in PatchTSTMeanScaler
      
      * remove arguments in PatchTSTStdScaler
      
      * add config as an argument to all the scaler classes
      
      * reformat
      
      * Add norm_eps for batchnorm and layernorm
      
      * reformat.
      
      * reformat
      
      * edit docstring
      
      * update docstring
      
      * change variable name pooling to pooling_type
      
      * fix output_hidden_states as tuple
      
      * fix bug when calling PatchTSTBatchNorm
      
      * change stride to patch_stride
      
      * create PatchTSTPositionalEncoding class and restructure the PatchTSTEncoder
      
      * formatting
      
      * initialize scalers with configs
      
      * edit output_hidden_states
      
      * style
      
      * fix forecast_mask_patches doc string
      
      ---------
      Co-authored-by: default avatarGift Sinthong <gift.sinthong@ibm.com>
      Co-authored-by: default avatarNam Nguyen <namctin@gmail.com>
      Co-authored-by: default avatarVijay Ekambaram <vijaykr.e@gmail.com>
      Co-authored-by: default avatarNgoc Diep Do <55230119+diepi@users.noreply.github.com>
      Co-authored-by: default avatarWesley Gifford <79663411+wgifford@users.noreply.github.com>
      Co-authored-by: default avatarWesley M. Gifford <wmgifford@us.ibm.com>
      Co-authored-by: default avatarnnguyen <nnguyen@us.ibm.com>
      Co-authored-by: default avatarNgoc Diep Do <diiepy@gmail.com>
      Co-authored-by: default avatarKashif Rasul <kashif.rasul@gmail.com>
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      2ac5b932
    • Younes Belkada's avatar
      [`AWQ` ] Addresses TODO for awq tests (#27467) · 7b139023
      Younes Belkada authored
      addresses todo for awq tests
      7b139023
    • NielsRogge's avatar
      Add DINOv2 depth estimation (#26092) · 2422c38d
      NielsRogge authored
      
      
      * First draft
      
      * Fix style
      
      * More improvements
      
      * Fix tests
      
      * Fix tests
      
      * Convert checkpoint
      
      * Improve DPTImageProcessor
      
      * Remove scripts, improve conversion script
      
      * Remove print statements
      
      * Fix test
      
      * Improve docstring
      
      * More improvements
      
      * Fix style
      
      * Fix image processor
      
      * Add tests
      
      * Address comments
      
      * Address comments
      
      * Make bias backwards compatible
      
      * Address comment
      
      * Address comment
      
      * Address comment
      
      * Apply suggestions from code review
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Address comments
      
      * Add flag
      
      * Add tests
      
      * Make tests smaller
      
      * Use regular BackboneOutput
      
      * Fix all tests
      
      * Update test
      
      * Convert more checkpoints
      
      * Convert giant checkpoints, add integration test
      
      * Rename size_divisibility to size_divisor
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      2422c38d
    • Lysandre Debut's avatar
      Fix `from_pt` flag when loading with `safetensors` (#27394) · 68ae3be7
      Lysandre Debut authored
      * Fix
      
      * Tests
      
      * Fix
      68ae3be7
    • Lysandre Debut's avatar
      Default to msgpack for safetensors (#27460) · 9dc8fe1b
      Lysandre Debut authored
      
      
      * Default to msgpack for safetensors
      
      * Apply suggestions from code review
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      9dc8fe1b
    • Arthur's avatar
      Remove-auth-token (#27060) · b97cab7e
      Arthur authored
      * don't use `use_auth_token`internally
      
      * let's use token everywhere
      
      * fixup
      b97cab7e
  2. 10 Nov, 2023 5 commits
    • amyeroberts's avatar
      Normalize floating point cast (#27249) · ed115b34
      amyeroberts authored
      * Normalize image - cast input images to float32.
      
      This is done if the input image isn't of floating type. Issues can occur when do_rescale=False is set in an image processor. When this happens, the image passed to the call is of type uint8 becuase of the type casting that happens in resize because of the PIL image library. As the mean and std values are cast to match the image dtype, this can cause NaNs and infs to appear in the normalized image, as the floating values being used to divide the image are now set to 0.
      
      The reason the mean and std values are cast is because previously they were set as float32 by default. However, if the input image was of type float16, the normalization would result in the image being upcast to float32 too.
      
      * Add tests
      
      * Remove float32 cast
      ed115b34
    • Susnato Dhar's avatar
      Add Phi-1 and Phi-1_5 (#26170) · e1c3ac25
      Susnato Dhar authored
      * only dir not even init
      
      * init
      
      * tokenizer removed and reference of codegen added
      
      * modeling file updated a lot remaining app_rotary_emb
      
      * conversion script done
      
      * conversion script fixed, a lot of factoring done and most tests pass
      
      * added token_clf and extractive_QA_head
      
      * integration tests pass
      
      * flash attn tests pass!
      
      * config done
      
      * more docs in modeling file
      
      * some style fix
      
      * style and others
      
      * doc test error fix
      
      * more doc fix
      
      * some attention fixes
      
      * most fixes
      
      * style and other fixes
      
      * docs fix and config
      
      * doc fix
      
      * some comments
      
      * conversion script updated
      
      * conversion script updated
      
      * Revert "conversion script updated"
      
      This reverts commit e92378c54084ec0747041b113083d1746ecb6c7f.
      
      * final comments
      
      * add Phi to language_modeling.md
      
      * edit phi.md file
      
      * rebase and fix
      
      * removed phi-1.5 example
      
      * changed model_type from 'phi'->'mixformer-sequential'
      
      * small change
      
      * small change
      
      * revert \small change
      
      * changed mixformer-sequential->phi
      
      * small change
      
      * added phi-1.5 example instead of phi-1
      
      * doc test might pass now
      
      * rebase and small change
      
      * added the dropout layer
      
      * more fixes
      
      * modified .md file
      
      * very very small doc change
      e1c3ac25
    • Arthur's avatar
      [`AttentionMaskConverter`] ]Fix-mask-inf (#27114) · 68afca3e
      Arthur authored
      * fix?
      
      * actual fix
      
      * fixups
      
      * add dataclass to the attention mask converter
      
      * refine testing suite
      
      * make sure there are no overflows
      
      * update the test
      68afca3e
    • Susnato Dhar's avatar
      Add CLVP (#24745) · 7e9f10ac
      Susnato Dhar authored
      * init commit
      
      * attention arch done except rotary emb
      
      * rotary emb done
      
      * text encoder working
      
      * outputs matching
      
      * arch first pass done
      
      * make commands done, tests and docs remaining
      
      * all tests passed, only docs remaining
      
      * docs done
      
      * doc-builder fix
      
      * convert script removed(not relevant)
      
      * minor comments done
      
      * added ckpt conversion script
      
      * tokenizer done
      
      * very minor fix of index.md 2
      
      * mostly make fixup related
      
      * all done except fe and rotary emb
      
      * very small change
      
      * removed unidecode dependency
      
      * style changes
      
      * tokenizer removed require_backends
      
      * added require_inflect to tokenizer tests
      
      * removed VOCAB_FILES in tokenizer test
      
      * inflect dependency removed
      
      * added rotary pos emb cache and simplified the apply method
      
      * style
      
      * little doc change
      
      * more comments
      
      * feature extractor added
      
      * added processor
      
      * auto-regressive config added
      
      * added CLVPConditioningEncoder
      
      * comments done except the test one
      
      * weights added successfull(NOT tested)
      
      * tokenizer fix with numbers
      
      * generate outputs matching
      
      * almost tests passing Integ tests not written
      
      * Integ tests added
      
      * major CUDA error fixed
      
      * docs done
      
      * rebase and multiple fixes
      
      * fixed rebase overwrites
      
      * generate code simplified and tests for AutoRegressive model added
      
      * minor changes
      
      * refectored gpt2 code in clvp file
      
      * weights done and all code refactored
      
      * mostly done except the fast_tokenizer
      
      * doc test fix
      
      * config file's doc fixes
      
      * more config fix
      
      * more comments
      
      * tokenizer comments mostly done
      
      * modeling file mostly refactored and can load modules
      
      * ClvpEncoder tested
      
      * ClvpDecoder, ClvpModel and ClvpForCausalLM tested
      
      * integration and all tests passed
      
      * more fixes
      
      * docs almost done
      
      * ckpt conversion refectored
      
      * style and some failing tests fix
      
      * comments
      
      * temporary output fix but test_assisted_decoding_matches_greedy_search test fails
      
      * majority changes done
      
      * use_cache outputs same now! Along with the asisted_greedy_decoding test fix
      
      * more comments
      
      * more comments
      
      * prepare_inputs_for_generation fixed and _prepare_model_inputs added
      
      * style fix
      
      * clvp.md change
      
      * moved clvpconditionalencoder norms
      
      * add model to new index
      
      * added tokenizer input_ids_with_special_tokens
      
      * small fix
      
      * config mostly done
      
      * added config-tester and changed conversion script
      
      * more comments
      
      * comments
      
      * style fix
      
      * some comments
      
      * tokenizer changed back to prev state
      
      * small commnets
      
      * added output hidden states for the main model
      
      * style fix
      
      * comments
      
      * small change
      
      * revert small change
      
      * .
      
      * Update clvp.md
      
      * Update test_modeling_clvp.py
      
      * :)
      
      * some minor change
      
      * new fixes
      
      * remove to_dict from FE
      7e9f10ac
    • Younes Belkada's avatar
      [`Quantization`] Add str to enum conversion for AWQ (#27320) · fd685cfd
      Younes Belkada authored
      
      
      * add str to enum conversion
      
      * fixup
      
      * Apply suggestions from code review
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      fd685cfd
  3. 09 Nov, 2023 7 commits
  4. 08 Nov, 2023 4 commits
  5. 07 Nov, 2023 3 commits
  6. 06 Nov, 2023 2 commits
  7. 03 Nov, 2023 3 commits
  8. 02 Nov, 2023 6 commits
  9. 01 Nov, 2023 4 commits