Closed Huge closed 1 year ago
Hi, Sorry for the confusion. I have corrected the main readme.md example. You need to pass labels = None
and eval(result['text'])
. Here is a working example
from promptify import OpenAI
from promptify import Prompter
sentence = """The patient is a 93-year-old female with a medical
history of chronic right hip pain, osteoporosis,
hypertension, depression, and chronic atrial
fibrillation admitted for evaluation and management
of severe nausea and vomiting and urinary tract
infection"""
model = OpenAI("your_key")
nlp_prompter = Prompter(model)
result = nlp_prompter.fit('ner.jinja', domain ='medical', text_input = sentence, labels = None)
eval(result['text'])
That's still an issue. It already occures on from promptify import OpenAI
.
One solution is to downgrade markersafe: pip install markupsafe==2.0.1
With python3.10, the code fails with
ImportError: cannot import name 'soft_unicode' from 'markupsafe'
.https://github.com/aws/aws-sam-cli/issues/3661#issuecomment-1044340547 helps fixing that. Still with that change, with the introductory example we get
It would be great if the main setup instructions work out of the box.