Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlongWY committed Jun 18, 2020
1 parent f8104f6 commit 36c491b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ API文档
:titlesonly:
:glob:

introduction
quickstart
performance

api/ltp*


Expand Down
7 changes: 2 additions & 5 deletions ltp/ltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,14 @@ def __init__(self, path: str = 'small', batch_size: int = 10, device=None, vocab
self.device = torch.device('cuda')
else:
self.device = torch.device('cpu')
if os.path.exists(path):
ckpt = torch.load(os.path.join(path, "ltp.model"), map_location=self.device)
self.tokenizer = AutoTokenizer.from_pretrained(path, use_fast=True)
elif path in model_map:
if path in model_map or os.path.exists(path):
cache_dir = kwargs.pop("cache_dir", LTP_CACHE)
force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", False)
proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", False)
resolved_archive_path = cached_path(
model_map[path],
model_map.get(path, path),
cache_dir=cache_dir,
force_download=force_download,
proxies=proxies,
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ pretty_errors
pytest

#doc
sphinx
sphinx_rtd_theme
sphinx~=3.1.1
sphinx_rtd_theme~=0.4.0

# Server
tornado~=6.0.4
Expand Down

0 comments on commit 36c491b

Please sign in to comment.