promptslab / Promptify

Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
https://discord.gg/m88xfYMbK6
Apache License 2.0
3.11k stars 232 forks source link

How to create my own templates #45

Closed reborm closed 1 year ago

reborm commented 1 year ago

I create xxx.jinja as my own templates, then I tried theses code: prompt = nlp_prompter.generate_prompt('business_analysis.jinja', text_input="GMV下降的原因", domain="business analysis" ) print(prompt) sentence="GMV下降的原因" result = nlp_prompter.fit('business_analysis.jinja',domain='business analysis',text_input=sentence, labels=None) print(result)

here is the question, the "generate_prompt" and "fit" function can't find this template, I tried the absolute path, and even put this template along with the templates of Promptify

image

Could you please do me a favor

eren23 commented 1 year ago

Hello, the quickest way of testing your own templates would be installing the library with your changes I think,

so python setup.py install should make these templates available for you

monk1337 commented 1 year ago

fixed it in the new update https://github.com/promptslab/Promptify/blob/d8e2663293a9dbdb6723a72a489fc3705768736f/promptify/prompter/nlp_prompter.py#L177