Moved the encoded_prompts to correct device
0
.circleci/config.yml
Normal file → Executable file
0
.coveragerc
Normal file → Executable file
0
.github/ISSUE_TEMPLATE/---new-benchmark.md
vendored
Normal file → Executable file
0
.github/ISSUE_TEMPLATE/--new-model-addition.md
vendored
Normal file → Executable file
0
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file → Executable file
0
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file → Executable file
0
.github/ISSUE_TEMPLATE/migration.md
vendored
Normal file → Executable file
0
.github/ISSUE_TEMPLATE/question-help.md
vendored
Normal file → Executable file
0
.github/stale.yml
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
CONTRIBUTING.md
Normal file → Executable file
0
MANIFEST.in
Normal file → Executable file
0
deploy_multi_version_doc.sh
Normal file → Executable file
0
docker/Dockerfile
Normal file → Executable file
0
docs/Makefile
Normal file → Executable file
0
docs/README.md
Normal file → Executable file
0
docs/source/_static/css/Calibre-Light.ttf
Normal file → Executable file
0
docs/source/_static/css/Calibre-Medium.otf
Normal file → Executable file
0
docs/source/_static/css/Calibre-Regular.otf
Normal file → Executable file
0
docs/source/_static/css/Calibre-Thin.otf
Normal file → Executable file
0
docs/source/_static/css/code-snippets.css
Normal file → Executable file
0
docs/source/_static/css/huggingface.css
Normal file → Executable file
0
docs/source/_static/js/custom.js
Normal file → Executable file
0
docs/source/_static/js/huggingface_logo.svg
Normal file → Executable file
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
0
docs/source/benchmarks.md
Normal file → Executable file
0
docs/source/bertology.rst
Normal file → Executable file
0
docs/source/conf.py
Normal file → Executable file
0
docs/source/converting_tensorflow_models.rst
Normal file → Executable file
0
docs/source/imgs/transformers_logo_name.png
Normal file → Executable file
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
0
docs/source/imgs/warmup_constant_schedule.png
Normal file → Executable file
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
0
docs/source/imgs/warmup_cosine_hard_restarts_schedule.png
Normal file → Executable file
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
docs/source/imgs/warmup_cosine_schedule.png
Normal file → Executable file
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
0
docs/source/imgs/warmup_cosine_warm_restarts_schedule.png
Normal file → Executable file
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
0
docs/source/imgs/warmup_linear_schedule.png
Normal file → Executable file
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
0
docs/source/index.rst
Normal file → Executable file
0
docs/source/installation.md
Normal file → Executable file
0
docs/source/main_classes/configuration.rst
Normal file → Executable file
0
docs/source/main_classes/model.rst
Normal file → Executable file
0
docs/source/main_classes/optimizer_schedules.rst
Normal file → Executable file
0
docs/source/main_classes/processors.rst
Normal file → Executable file
0
docs/source/main_classes/tokenizer.rst
Normal file → Executable file
0
docs/source/migration.md
Normal file → Executable file
0
docs/source/model_doc/albert.rst
Normal file → Executable file
0
docs/source/model_doc/auto.rst
Normal file → Executable file
0
docs/source/model_doc/bert.rst
Normal file → Executable file
0
docs/source/model_doc/camembert.rst
Normal file → Executable file
0
docs/source/model_doc/ctrl.rst
Normal file → Executable file
0
docs/source/model_doc/distilbert.rst
Normal file → Executable file
0
docs/source/model_doc/gpt.rst
Normal file → Executable file
0
docs/source/model_doc/gpt2.rst
Normal file → Executable file
0
docs/source/model_doc/roberta.rst
Normal file → Executable file
0
docs/source/model_doc/transformerxl.rst
Normal file → Executable file
0
docs/source/model_doc/xlm.rst
Normal file → Executable file
0
docs/source/model_doc/xlnet.rst
Normal file → Executable file
0
docs/source/model_sharing.md
Normal file → Executable file
0
docs/source/multilingual.rst
Normal file → Executable file
0
docs/source/notebooks.rst
Normal file → Executable file
0
docs/source/pretrained_models.rst
Normal file → Executable file
0
docs/source/quickstart.md
Normal file → Executable file
0
docs/source/serialization.rst
Normal file → Executable file
0
docs/source/torchscript.rst
Normal file → Executable file
0
examples/README.md
Normal file → Executable file
0
examples/benchmarks.py
Normal file → Executable file
0
examples/contrib/README.md
Normal file → Executable file
0
examples/contrib/run_camembert.py
Normal file → Executable file
0
examples/contrib/run_openai_gpt.py
Normal file → Executable file
0
examples/contrib/run_swag.py
Normal file → Executable file
0
examples/contrib/run_transfo_xl.py
Normal file → Executable file
0
examples/distillation/README.md
Normal file → Executable file
0
examples/distillation/distiller.py
Normal file → Executable file
0
examples/distillation/grouped_batch_sampler.py
Normal file → Executable file
0
examples/distillation/lm_seqs_dataset.py
Normal file → Executable file
0
examples/distillation/requirements.txt
Normal file → Executable file
0
examples/distillation/run_squad_w_distillation.py
Normal file → Executable file
0
examples/distillation/scripts/binarized_data.py
Normal file → Executable file
0
examples/distillation/scripts/extract.py
Normal file → Executable file
0
examples/distillation/scripts/extract_distilbert.py
Normal file → Executable file
0
examples/distillation/scripts/token_counts.py
Normal file → Executable file
0
examples/distillation/train.py
Normal file → Executable file
0
examples/distillation/training_configs/distilbert-base-uncased.json
Normal file → Executable file
0
examples/distillation/training_configs/distilgpt2.json
Normal file → Executable file
0
examples/distillation/utils.py
Normal file → Executable file
0
examples/mm-imdb/run_mmimdb.py
Normal file → Executable file
0
examples/mm-imdb/utils_mmimdb.py
Normal file → Executable file
0
examples/pplm/README.md
Normal file → Executable file
0
examples/pplm/imgs/headfigure.png
Normal file → Executable file
Before Width: | Height: | Size: 653 KiB After Width: | Height: | Size: 653 KiB |
0
examples/pplm/imgs/wooly.png
Normal file → Executable file
Before Width: | Height: | Size: 664 KiB After Width: | Height: | Size: 664 KiB |
0
examples/pplm/pplm_classification_head.py
Normal file → Executable file
0
examples/pplm/run_pplm.py
Normal file → Executable file
0
examples/pplm/run_pplm_discrim_train.py
Normal file → Executable file
0
examples/requirements.txt
Normal file → Executable file
0
examples/run_bertology.py
Normal file → Executable file
1
examples/run_generation.py
Normal file → Executable file
@ -212,6 +212,7 @@ def main():
|
||||
prepare_input = PREPROCESSING_FUNCTIONS.get(args.model_type)
|
||||
prompt_text = prepare_input(args, model, tokenizer, prompt_text)
|
||||
encoded_prompt = tokenizer.encode(prompt_text, add_special_tokens=False, return_tensors="pt")
|
||||
encoded_prompt = encoded_prompt.to(args.device)
|
||||
|
||||
output_sequences = model.generate(
|
||||
input_ids=encoded_prompt,
|
||||
|