Skip to content

Commit

Permalink
0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanNile committed Sep 17, 2022
1 parent 654d0cc commit fd60c23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions freenlpc/freenlpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit fd60c23

Please sign in to comment.