-
Notifications
You must be signed in to change notification settings - Fork 12
Add custom prompt functionality #15
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
base: develop
Are you sure you want to change the base?
Conversation
Great to have you back on this project! 🚀 |
return self._generate_with_prompt(model_name, model_version, [image], caption_prompt) | ||
def generate_caption(self, model_name: str, model_version: str, image: Image, prompt) -> tuple[str, str]: | ||
|
||
if prompt == 'default': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if prompt == ''
(empty)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please check / confirm whether the following environment variables can still be used to set a default prompt for the corresponding endpoints:
OLLAMA_NSFW_PROMPT
OLLAMA_LABELS_PROMPT
OLLAMA_CAPTION_PROMPT
If they are set to an empty string or "default", the built-in default should be used. This default must never be "default" or empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if
prompt == ''
(empty)?
If the user doesn't supply a prompt or the prompt is an empty string, the default prompt will be used.
Note that I changed the caption default prompt to work well with the qwen2.5vl model. |
I manually applied your changes for the caption prompt so that we can start testing it while you finalize the pull request :) |
Description
These changes implement passing custom prompts to models as shown in the README.
Related Issues
Vision Service: Improve caption prompt and allow submitting a custom prompt with the request data
Acceptance Criteria
Contribution Agreement
When contributing code or other intellectual property for the first time, we ask that you read and agree to the following so that we can safely use it in all of our projects without risking unexpected legal disputes or having to repeatedly ask for permission:
PhotoPrism UG ("PhotoPrism", "we" or "us") hereby confirms to you that, to the fullest extent permitted by applicable law, this Contribution is provided "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. You have no obligation to provide support, maintenance, or other services for your Contribution.
This agreement is solely for our protection and that of our users. It does not grant us exclusive rights to your code.
Thank you very much! 🌈💎✨