From fd60c2325906a4c14155175156b2724dd7361758 Mon Sep 17 00:00:00 2001 From: AbdelrhmanNile Date: Sat, 17 Sep 2022 22:05:20 +0200 Subject: [PATCH] 0.1.8 --- freenlpc/freenlpc.py | 6 ++++-- setup.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/freenlpc/freenlpc.py b/freenlpc/freenlpc.py index c6685a8..bceacc9 100644 --- a/freenlpc/freenlpc.py +++ b/freenlpc/freenlpc.py @@ -39,11 +39,13 @@ def __check_keys(self): for i in range(len(self.__api_keys)): try: nlpcloud.Client(self.which_model("sentiment_pos_neg"), - self.__api_keys[i], lang="en").sentiment("i hate physics") + self.__api_keys[i], lang="en").sentiment("this pizze is good") except requests.exceptions.HTTPError as e: if str(e).find("Unauthorized") != -1: raise Exception( - f"API Token at index {i} is not valid.") + f"NLPCLOUD API Token at index {i} is not valid.") + else: + raise e def which_model(self, task_name): """which model is being used for a specific task. diff --git a/setup.py b/setup.py index c0f9071..3d44792 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -VERSION = '0.1.7' +VERSION = '0.1.8' DESCRIPTION = 'A wrapper for nlpcloud free-tier services with no requests per minute limits.' LONG_DESCRIPTION = """# freenlpc a wrapper for nlpcloud free-tier.