Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error expected str, bytes or os.PathLike object, not NoneType #84

Open
aymalkhalid opened this issue Jun 30, 2023 · 0 comments
Open

Error expected str, bytes or os.PathLike object, not NoneType #84

aymalkhalid opened this issue Jun 30, 2023 · 0 comments

Comments

@aymalkhalid
Copy link

I am using promptify for solving NER Problem everything works fine except sometimes when it returns an Error for Nonetype which means it's empty but on the exception I am also passing it as a plain string but still same error.
It works fine after pausing for 1 minute or more but again it returns NoneType when I am testing it for continous requests.
image


from promptify.models.nlp.openai_model import OpenAI
from promptify.prompts.nlp.prompter import Prompter


try:
    model = OpenAI(openai.api_key)
except Exception as e:
    print("Error",e)
    model = OpenAI("me-2asdasdasdT123123.........")

#Initialize Prompter
nlp_prompter = Prompter(model)
ner_result = nlp_prompter.fit('ner.jinja',
                        domain      = 'Hospitality',
                        text_input=str('My name is Aymal'),
                        description= "The API response below contains user name"
                        )
 print("NER RESULT",ner_result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant