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
Traceback (most recent call last):
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/train_bash.py", line 14, in
main()
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/train_bash.py", line 5, in main
run_exp()
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/llmtuner/train/tuner.py", line 26, in run_exp
run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/llmtuner/train/sft/workflow.py", line 85, in run_sft
predict_results = trainer.predict(dataset, metric_key_prefix="predict", **gen_kwargs)
File "/home/yyd/anaconda3/envs/llama_factory_2/lib/python3.10/site-packages/transformers/trainer_seq2seq.py", line 228, in predict
return super().predict(test_dataset, ignore_keys=ignore_keys, metric_key_prefix=metric_key_prefix)
File "/home/yyd/anaconda3/envs/llama_factory_2/lib/python3.10/site-packages/transformers/trainer.py", line 3142, in predict
output = eval_loop(
File "/home/yyd/anaconda3/envs/llama_factory_2/lib/python3.10/site-packages/transformers/trainer.py", line 3359, in evaluation_loop
metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/llmtuner/train/sft/metric.py", line 51, in call
rouge = Rouge()
NameError: name 'Rouge' is not defined. Did you mean: 'rouge'?
这一段代码为什么会报错呀:
for pred, label in zip(decoded_preds, decoded_labels):
hypothesis = list(jieba.cut(pred))
reference = list(jieba.cut(label))
if len(" ".join(hypothesis).split()) == 0 or len(" ".join(reference).split()) == 0:
result = {"rouge-1": {"f": 0.0}, "rouge-2": {"f": 0.0}, "rouge-l": {"f": 0.0}}
else:
rouge = Rouge()
scores = rouge.get_scores(" ".join(hypothesis), " ".join(reference))
result = scores[0]
The text was updated successfully, but these errors were encountered:
Reminder
Reproduction
CUDA_VISIBLE_DEVICES=1 python /home/yyd/code/chat/LLaMA-Factory_231116/src/train_bash.py
--stage sft
--model_name_or_path /home/yyd/code/chat/models/ChatGLM3-6B
--do_predict True
--dataset_dir /home/yyd/code/chat/LLaMA-Factory_231116/data
--dataset steel_QA_test_2661
--template chatglm3
--finetuning_type lora
--checkpoint_dir $checkpoint_dir
--output_dir $output_dir
--per_device_eval_batch_size 4
--max_samples 100
--cutoff_len 256
--max_new_tokens 256
--predict_with_generate True
Expected behavior
No response
System Info
No response
Others
Traceback (most recent call last):
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/train_bash.py", line 14, in
main()
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/train_bash.py", line 5, in main
run_exp()
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/llmtuner/train/tuner.py", line 26, in run_exp
run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/llmtuner/train/sft/workflow.py", line 85, in run_sft
predict_results = trainer.predict(dataset, metric_key_prefix="predict", **gen_kwargs)
File "/home/yyd/anaconda3/envs/llama_factory_2/lib/python3.10/site-packages/transformers/trainer_seq2seq.py", line 228, in predict
return super().predict(test_dataset, ignore_keys=ignore_keys, metric_key_prefix=metric_key_prefix)
File "/home/yyd/anaconda3/envs/llama_factory_2/lib/python3.10/site-packages/transformers/trainer.py", line 3142, in predict
output = eval_loop(
File "/home/yyd/anaconda3/envs/llama_factory_2/lib/python3.10/site-packages/transformers/trainer.py", line 3359, in evaluation_loop
metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
File "/home/yyd/code/chat/LLaMA-Factory_231116/src/llmtuner/train/sft/metric.py", line 51, in call
rouge = Rouge()
NameError: name 'Rouge' is not defined. Did you mean: 'rouge'?
这一段代码为什么会报错呀:
for pred, label in zip(decoded_preds, decoded_labels):
hypothesis = list(jieba.cut(pred))
reference = list(jieba.cut(label))
The text was updated successfully, but these errors were encountered: