ibm / gpt2-medium-multiexit

huggingface.co
Total runs: 109
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: May 04 2023
text-generation

Introduction of gpt2-medium-multiexit

Model Details of gpt2-medium-multiexit

GPT-2 Medium Multi-Exit

Pre-trained language model with identical parameters to gpt2-medium , but with additional language modeling heads ("exits") connected to different layers of the model.

These 12 additional heads (in layers 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24) were trained on the English portion of CC-100 while keeping the original pre-trained model parameters frozen.

The model can be used for the Autocontrastive Decoding text generation approach described in Gera et al. 2023 , for early-exiting approaches, or for other algorithms that consider the next-token predictions of different model layers.

Usage

Harnessing the additional language modeling heads requires loading the model using the auto-contrastive-generation library ( pip install autocontrastive-gen ).

In a nutshell, the user creates a MultiExitConfiguration that determines model behavior at training and inference, and then loads the model using the dedicated AutoMultiExitModel class. After that, the model can be used with the transformers API like any other model. See the GitHub for detailed usage instructions.

For example, the code below initializes the model to use Autocontrastive Decoding , and then performs text generation in this chosen setting:

from transformers import AutoTokenizer
from autocontrastive_gen.modeling.configuration import MultiExitConfiguration
from autocontrastive_gen.modeling.auto_model import AutoMultiExitModel

# initialize a pre-trained multi-exit model to use auto-contrast between layer 24 and layer 12
multi_exit_config = MultiExitConfiguration(use_original_head=False, 
                                           contrast_layer_indices=(24, 12))
model = AutoMultiExitModel.from_pretrained("IBM/gpt2-medium-multiexit", multi_exit_config=multi_exit_config)

# perform text generation as usual
tokenizer = AutoTokenizer.from_pretrained("IBM/gpt2-medium-multiexit")
prompt = tokenizer("humpty dumpty sat on", return_tensors='pt')
generated_ids = model.generate(**prompt, max_new_tokens=15)
print(tokenizer.batch_decode(generated_ids))
Citation

Ariel Gera, Roni Friedman, Ofir Arviv, Chulaka Gunasekara, Benjamin Sznajder, Noam Slonim and Eyal Shnarch. The Benefits of Bad Advice: Autocontrastive Decoding across Model Layers . ACL 2023.

@inproceedings{gera2023autocontrastive,
  title={The Benefits of Bad Advice: Autocontrastive Decoding across Model Layers},
  author={Gera, Ariel and Friedman, Roni and Arviv, Ofir and Gunasekara, Chulaka and Sznajder, Benjamin and Slonim, Noam and Shnarch, Eyal},
  booktitle={Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  month={july},
  address={Toronto, Canada},
  year={2023}
}

Runs of ibm gpt2-medium-multiexit on huggingface.co

109
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About gpt2-medium-multiexit huggingface.co Model

More gpt2-medium-multiexit license Visit here:

https://choosealicense.com/licenses/mit

gpt2-medium-multiexit huggingface.co

gpt2-medium-multiexit huggingface.co is an AI model on huggingface.co that provides gpt2-medium-multiexit's model effect (), which can be used instantly with this ibm gpt2-medium-multiexit model. huggingface.co supports a free trial of the gpt2-medium-multiexit model, and also provides paid use of the gpt2-medium-multiexit. Support call gpt2-medium-multiexit model through api, including Node.js, Python, http.

gpt2-medium-multiexit huggingface.co Url

https://huggingface.co/ibm/gpt2-medium-multiexit

ibm gpt2-medium-multiexit online free

gpt2-medium-multiexit huggingface.co is an online trial and call api platform, which integrates gpt2-medium-multiexit's modeling effects, including api services, and provides a free online trial of gpt2-medium-multiexit, you can try gpt2-medium-multiexit online for free by clicking the link below.

ibm gpt2-medium-multiexit online free url in huggingface.co:

https://huggingface.co/ibm/gpt2-medium-multiexit

gpt2-medium-multiexit install

gpt2-medium-multiexit is an open source model from GitHub that offers a free installation service, and any user can find gpt2-medium-multiexit on GitHub to install. At the same time, huggingface.co provides the effect of gpt2-medium-multiexit install, users can directly use gpt2-medium-multiexit installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gpt2-medium-multiexit install url in huggingface.co:

https://huggingface.co/ibm/gpt2-medium-multiexit

Url of gpt2-medium-multiexit

gpt2-medium-multiexit huggingface.co Url

Provider of gpt2-medium-multiexit huggingface.co

ibm
ORGANIZATIONS

Other API from ibm

huggingface.co

Total runs: 28.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 12 2024
huggingface.co

Total runs: 17.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 17 2024
huggingface.co

Total runs: 15.3K
Run Growth: 0
Growth Rate: 0.00%
Updated:September 25 2024
huggingface.co

Total runs: 11.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:September 16 2024
huggingface.co

Total runs: 11.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:March 05 2024
huggingface.co

Total runs: 2.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 17 2024
huggingface.co

Total runs: 344
Run Growth: 0
Growth Rate: 0.00%
Updated:December 21 2022
huggingface.co

Total runs: 157
Run Growth: 0
Growth Rate: 0.00%
Updated:December 28 2023
huggingface.co

Total runs: 103
Run Growth: 0
Growth Rate: 0.00%
Updated:October 12 2022
huggingface.co

Total runs: 90
Run Growth: 0
Growth Rate: 0.00%
Updated:February 07 2023
huggingface.co

Total runs: 57
Run Growth: 0
Growth Rate: 0.00%
Updated:March 05 2024
huggingface.co

Total runs: 56
Run Growth: 0
Growth Rate: 0.00%
Updated:October 09 2024
huggingface.co

Total runs: 23
Run Growth: 0
Growth Rate: 0.00%
Updated:September 15 2023
huggingface.co

Total runs: 18
Run Growth: 0
Growth Rate: 0.00%
Updated:September 15 2023
huggingface.co

Total runs: 16
Run Growth: 0
Growth Rate: 0.00%
Updated:September 15 2023