fixed imports in tests and gpt2 config test

This commit is contained in:
thomwolf
2019-09-09 11:04:03 +02:00
parent 728637356c
commit b7175a2701
20 changed files with 53 additions and 40 deletions

View File

@@ -22,12 +22,12 @@ import pytest
from pytorch_transformers import is_torch_available
try:
if is_torch_available():
import torch
from pytorch_transformers import (AdamW, ConstantLRSchedule, WarmupConstantSchedule,
WarmupCosineSchedule, WarmupCosineWithHardRestartsSchedule, WarmupLinearSchedule)
except ImportError:
else:
pytestmark = pytest.mark.skip("Require Torch")
from .tokenization_tests_commons import TemporaryDirectory