Moved the encoded_prompts to correct device
This commit is contained in:
committed by
Lysandre Debut
parent
1efc208ff3
commit
dd4df80f0b
0
examples/README.md
Normal file → Executable file
0
examples/README.md
Normal file → Executable file
0
examples/benchmarks.py
Normal file → Executable file
0
examples/benchmarks.py
Normal file → Executable file
0
examples/contrib/README.md
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_camembert.py
Normal file → Executable file
0
examples/contrib/run_openai_gpt.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_swag.py
Normal file → Executable file
0
examples/contrib/run_transfo_xl.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/README.md
Normal file → Executable file
0
examples/distillation/distiller.py
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/grouped_batch_sampler.py
Normal file → Executable file
0
examples/distillation/lm_seqs_dataset.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/requirements.txt
Normal file → Executable file
0
examples/distillation/run_squad_w_distillation.py
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/binarized_data.py
Normal file → Executable file
0
examples/distillation/scripts/extract.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/extract_distilbert.py
Normal file → Executable file
0
examples/distillation/scripts/token_counts.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/train.py
Normal file → Executable file
0
examples/distillation/training_configs/distilbert-base-uncased.json
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/training_configs/distilgpt2.json
Normal file → Executable file
0
examples/distillation/utils.py
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/run_mmimdb.py
Normal file → Executable file
0
examples/mm-imdb/utils_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/README.md
Normal file → Executable file
0
examples/pplm/imgs/headfigure.png
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
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/pplm_classification_head.py
Normal file → Executable file
0
examples/pplm/run_pplm.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/pplm/run_pplm_discrim_train.py
Normal file → Executable file
0
examples/requirements.txt
Normal file → Executable file
0
examples/requirements.txt
Normal file → Executable file
0
examples/run_bertology.py
Normal file → Executable file
0
examples/run_bertology.py
Normal file → Executable file
1
examples/run_generation.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,
|
||||
|
||||
0
examples/run_glue.py
Normal file → Executable file
0
examples/run_glue.py
Normal file → Executable file
0
examples/run_lm_finetuning.py
Normal file → Executable file
0
examples/run_lm_finetuning.py
Normal file → Executable file
0
examples/run_multiple_choice.py
Normal file → Executable file
0
examples/run_multiple_choice.py
Normal file → Executable file
0
examples/run_ner.py
Normal file → Executable file
0
examples/run_ner.py
Normal file → Executable file
0
examples/run_squad.py
Normal file → Executable file
0
examples/run_squad.py
Normal file → Executable file
0
examples/run_tf_glue.py
Normal file → Executable file
0
examples/run_tf_glue.py
Normal file → Executable file
0
examples/run_tf_ner.py
Normal file → Executable file
0
examples/run_tf_ner.py
Normal file → Executable file
0
examples/run_xnli.py
Normal file → Executable file
0
examples/run_xnli.py
Normal file → Executable file
0
examples/summarization/README.md
Normal file → Executable file
0
examples/summarization/README.md
Normal file → Executable file
0
examples/summarization/configuration_bertabs.py
Normal file → Executable file
0
examples/summarization/configuration_bertabs.py
Normal file → Executable file
0
examples/summarization/convert_bertabs_original_pytorch_checkpoint.py
Normal file → Executable file
0
examples/summarization/convert_bertabs_original_pytorch_checkpoint.py
Normal file → Executable file
0
examples/summarization/modeling_bertabs.py
Normal file → Executable file
0
examples/summarization/modeling_bertabs.py
Normal file → Executable file
0
examples/summarization/requirements.txt
Normal file → Executable file
0
examples/summarization/requirements.txt
Normal file → Executable file
0
examples/summarization/run_summarization.py
Normal file → Executable file
0
examples/summarization/run_summarization.py
Normal file → Executable file
0
examples/summarization/test_utils_summarization.py
Normal file → Executable file
0
examples/summarization/test_utils_summarization.py
Normal file → Executable file
0
examples/summarization/utils_summarization.py
Normal file → Executable file
0
examples/summarization/utils_summarization.py
Normal file → Executable file
0
examples/test_examples.py
Normal file → Executable file
0
examples/test_examples.py
Normal file → Executable file
0
examples/tests_samples/.gitignore
vendored
Normal file → Executable file
0
examples/tests_samples/.gitignore
vendored
Normal file → Executable file
0
examples/tests_samples/MRPC/dev.tsv
Normal file → Executable file
0
examples/tests_samples/MRPC/dev.tsv
Normal file → Executable file
|
Can't render this file because it contains an unexpected character in line 3 and column 155.
|
0
examples/tests_samples/MRPC/train.tsv
Normal file → Executable file
0
examples/tests_samples/MRPC/train.tsv
Normal file → Executable file
|
Can't render this file because it contains an unexpected character in line 3 and column 155.
|
0
examples/tests_samples/SQUAD/dev-v2.0.json
Normal file → Executable file
0
examples/tests_samples/SQUAD/dev-v2.0.json
Normal file → Executable file
0
examples/tests_samples/SQUAD/train-v2.0.json
Normal file → Executable file
0
examples/tests_samples/SQUAD/train-v2.0.json
Normal file → Executable file
0
examples/utils_multiple_choice.py
Normal file → Executable file
0
examples/utils_multiple_choice.py
Normal file → Executable file
0
examples/utils_ner.py
Normal file → Executable file
0
examples/utils_ner.py
Normal file → Executable file
Reference in New Issue
Block a user