We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cb4150 commit 39faf36Copy full SHA for 39faf36
trl/__init__.py
@@ -12,18 +12,16 @@
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
+from importlib.metadata import PackageNotFoundError, version
16
from pathlib import Path
17
from typing import TYPE_CHECKING
18
19
from .import_utils import OptionalDependencyNotAvailable, _LazyModule, is_diffusers_available
20
21
-# Read version from VERSION file
22
-_version_file = Path(__file__).parent.parent / "VERSION"
23
try:
24
- with open(_version_file, encoding="utf-8") as f:
25
- __version__ = f.read().strip()
26
-except FileNotFoundError:
+ __version__ = version("trl")
+except PackageNotFoundError:
27
__version__ = "unknown"
28
29
_import_structure = {
0 commit comments