[doc] add no build isolation (#8103)
This commit is contained in:
@@ -63,8 +63,8 @@ if is_transformers_version_greater_than("4.49.0"):
|
||||
except ImportError:
|
||||
try:
|
||||
# If that fails, try importing from the new location
|
||||
from transformers.video_utils import make_batched_videos
|
||||
from transformers.image_utils import make_flat_list_of_images
|
||||
from transformers.video_utils import make_batched_videos
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"Could not import make_batched_videos and make_flat_list_of_images. "
|
||||
|
||||
@@ -84,14 +84,15 @@ def run_pt(
|
||||
perplexity = math.exp(metrics[f"eval_{key}_loss"])
|
||||
except OverflowError:
|
||||
perplexity = float("inf")
|
||||
|
||||
metrics[f"eval_{key}_perplexity"] = perplexity
|
||||
else:
|
||||
try:
|
||||
perplexity = math.exp(metrics["eval_loss"])
|
||||
except OverflowError:
|
||||
perplexity = float("inf")
|
||||
metrics["eval_perplexity"] = perplexity
|
||||
|
||||
metrics["eval_perplexity"] = perplexity
|
||||
|
||||
trainer.log_metrics("eval", metrics)
|
||||
trainer.save_metrics("eval", metrics)
|
||||
|
||||
Reference in New Issue
Block a user