Skip to content

Commit

Permalink
Back compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
attardi committed Nov 26, 2020
1 parent 544b61c commit 35490e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions diaparser/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

RELEASE = 'v1.0'
DOWNLOAD_URL = f'https://github.com/Unipisa/diaparser/releases/download/{RELEASE}'
UPLOAD_URL = f'https://uploads.github.com/repos/Unipisa/diaparser/releases/{RELEASE}/assets'
UPLOAD_COMMAND = f'curl -X POST -H "Content-Type: application/zip" {UPLOAD_URL}'

DEFAULT_CATALOG_URL = DOWNLOAD_URL
DEFAULT_CATALOG_VERSION = __models_version__
Expand Down
3 changes: 2 additions & 1 deletion diaparser/parsers/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def predict(self, data, pred=None, buckets=8, batch_size=5000, prob=False, **kwa
self.transform.eval()
if args.prob:
self.transform.append(Field('probs'))
if args.text:
if hasattr(args, 'text') and args.text \
or hasattr(args, 'lang') and args.lang: # PATCH: back compatibility
self.transform.reader = Tokenizer(args.text, dir=args.cache_dir).reader()

logger.info("Loading the data")
Expand Down

0 comments on commit 35490e5

Please sign in to comment.