You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried your command template as follow:
#################################
rel=P101
dir=outputs/${rel}
mkdir -p ${dir}
python code/run_optiprompt.py
--relation_profile relation_metainfo/LAMA_relations.jsonl
--relation ${rel}
--common_vocab_filename common_vocabs/common_vocab_cased.txt
--model_name bert-base-cased
--do_train
--train_data data/autoprompt_data/${rel}/train.jsonl
--dev_data data/autoprompt_data/${rel}/dev.jsonl
--do_eval
--test_data data/LAMA-TREx/${rel}.jsonl
--output_dir ${dir}
--random_init none
--output_predictions
#################################
However, an error was given as follow:
#########################
Traceback (most recent call last):
File "code/run_optiprompt.py", line 174, in
best_result, result_rel = evaluate(model, valid_samples_batches, valid_sentences_batches, filter_indices, index_list)
File "/home/prompt/OptiPrompt/code/utils.py", line 133, in evaluate
eval_loss += loss.item() * tot_b
ValueError: only one element tensors can be converted to Python scalars
##########################
How can I sovle it? Thanks~
The text was updated successfully, but these errors were encountered:
I tried your command template as follow:
#################################
rel=P101
dir=outputs/${rel}
mkdir -p ${dir}
python code/run_optiprompt.py
--relation_profile relation_metainfo/LAMA_relations.jsonl
--relation ${rel}
--common_vocab_filename common_vocabs/common_vocab_cased.txt
--model_name bert-base-cased
--do_train
--train_data data/autoprompt_data/${rel}/train.jsonl
--dev_data data/autoprompt_data/${rel}/dev.jsonl
--do_eval
--test_data data/LAMA-TREx/${rel}.jsonl
--output_dir ${dir}
--random_init none
--output_predictions
#################################
However, an error was given as follow:
#########################
Traceback (most recent call last):
File "code/run_optiprompt.py", line 174, in
best_result, result_rel = evaluate(model, valid_samples_batches, valid_sentences_batches, filter_indices, index_list)
File "/home/prompt/OptiPrompt/code/utils.py", line 133, in evaluate
eval_loss += loss.item() * tot_b
ValueError: only one element tensors can be converted to Python scalars
##########################
How can I sovle it? Thanks~
The text was updated successfully, but these errors were encountered: