From 232321cb2b23404d4c136781d5ad684ff576b205 Mon Sep 17 00:00:00 2001 From: shenyuhan Date: Tue, 10 Sep 2019 15:09:01 +0800 Subject: [PATCH] add user_home, fix ci --- README.md | 7 +++---- demo/lac/lac_demo.py | 8 ++++---- demo/senta/senta_demo.py | 4 ++-- paddlehub/commands/config.py | 6 ++++-- paddlehub/common/dir.py | 1 + 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9dc75d9c..8331770b 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,8 @@ print(res) ### PaddleHub v1.1.0 -* PaddleHub 新增 ERNIE 2.0 - +* PaddleHub 新增 ERNIE 2.0 + ### PaddleHub v1.0.1 * 安装模型时自动选择与paddlepaddle版本适配的模型 @@ -163,7 +163,7 @@ print(res) * 全新发布[PaddleHub官网](https://www.paddlepaddle.org.cn/hub),易用性全面提升 * 新增29个预训练模型,覆盖文本、图像、视频三大领域;目前官方提供40个预训练模型 * Fine-tune API升级,灵活性与性能全面提升 - + ### PaddleHub v0.5.0 正式发布PaddleHub预训练模型管理工具,旨在帮助用户更高效的管理模型并开展迁移学习的工作。 @@ -174,4 +174,3 @@ print(res) 目前版本支持以下模型:词法分析LAC;情感分析Senta;目标检测SSD;图像分类ResNet, MobileNet, NASNet等。 * 迁移学习: 提供了基于预训练模型的Finetune API,用户通过少量代码即可完成迁移学习,包括BERT/ERNIE文本分类、序列标注、图像分类迁移等。 - diff --git a/demo/lac/lac_demo.py b/demo/lac/lac_demo.py index 59df78fb..2dafcdf9 100644 --- a/demo/lac/lac_demo.py +++ b/demo/lac/lac_demo.py @@ -19,10 +19,10 @@ if __name__ == "__main__": results = lac.lexical_analysis(data=inputs, use_gpu=True, batch_size=10) for result in results: if six.PY2: - print( - json.dumps(result['word'], encoding="utf8", ensure_ascii=False)) - print( - json.dumps(result['tag'], encoding="utf8", ensure_ascii=False)) + print(json.dumps( + result['word'], encoding="utf8", ensure_ascii=False)) + print(json.dumps( + result['tag'], encoding="utf8", ensure_ascii=False)) else: print(result['word']) print(result['tag']) diff --git a/demo/senta/senta_demo.py b/demo/senta/senta_demo.py index 328517d3..07446a86 100644 --- a/demo/senta/senta_demo.py +++ b/demo/senta/senta_demo.py @@ -21,7 +21,7 @@ if __name__ == "__main__": results[index]["text"] = text for index, result in enumerate(results): if six.PY2: - print( - json.dumps(results[index], encoding="utf8", ensure_ascii=False)) + print(json.dumps( + results[index], encoding="utf8", ensure_ascii=False)) else: print(results[index]) diff --git a/paddlehub/commands/config.py b/paddlehub/commands/config.py index b1bfaab1..22422d8a 100644 --- a/paddlehub/commands/config.py +++ b/paddlehub/commands/config.py @@ -80,8 +80,10 @@ class ConfigCommand(BaseCommand): @staticmethod def set_log_level(level): - if level not in ["CRITICAL", "FATAL", "ERROR", "WARN", - "WARNING", "INFO", "DEBUG", "NOTSET"]: + if level not in [ + "CRITICAL", "FATAL", "ERROR", "WARN", "WARNING", "INFO", + "DEBUG", "NOTSET" + ]: print("Allowed values include: " "CRITICAL, FATAL, ERROR, WARN, WARNING, INFO, DEBUG, NOTSET") return diff --git a/paddlehub/common/dir.py b/paddlehub/common/dir.py index f1990a14..fee18d54 100644 --- a/paddlehub/common/dir.py +++ b/paddlehub/common/dir.py @@ -14,6 +14,7 @@ # limitations under the License. import os + # TODO: Change dir.py's filename, this naming rule is not qualified -- GitLab