Skip to content

Commit

Permalink
Simplify Paddle import check (fxsjy#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseyXujin authored and fxsjy committed Dec 31, 2019
1 parent 0b74b6c commit 30ea8f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions jieba/_compat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import os
import sys
import importlib
import logging

log_console = logging.StreamHandler(sys.stderr)
Expand Down Expand Up @@ -30,7 +29,7 @@ def import_paddle():
"Now, back to jieba basic cut......")
return False
try:
if paddle.__version__ >= '1.6.1' or paddle.__version__ >= u'1.6.1':
if paddle.__version__ >= '1.6.1':
import paddle.fluid as fluid
import jieba.lac_small.predict as predict
import_paddle_check = True
Expand Down Expand Up @@ -81,9 +80,9 @@ def check_paddle_install():
is_paddle_installed = False
try:
import paddle
if importlib.find_module('paddle') and (paddle.__version__ >= '1.6.1' or paddle.__version__ >= u'1.6.1'):
if paddle.__version__ >= '1.6.1':
is_paddle_installed = True
elif paddle.__version__ < '1.6.1':
else:
is_paddle_installed = False
default_logger.debug("Check the paddle version is not correct, the current version is "+ paddle.__version__+","
"please use command to install paddle: pip uninstall paddlepaddle(-gpu), "
Expand Down

0 comments on commit 30ea8f9

Please sign in to comment.