Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions torchtext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import os

from torch.hub import _get_torch_home

# the following import has to happen first in order to load the torchtext C++ library
from torchtext import _extension # noqa: F401

_TEXT_BUCKET = "https://download.pytorch.org/models/text/"

_TORCH_HOME = os.getenv("TORCH_HOME")
if _TORCH_HOME is None:
_TORCH_HOME = "~/.cache/torch" # default
_CACHE_DIR = os.path.expanduser(os.path.join(_TORCH_HOME, "text"))
_CACHE_DIR = os.path.expanduser(os.path.join(_get_torch_home(), "text"))

from . import data, datasets, experimental, functional, models, nn, transforms, utils, vocab

Expand Down