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

Custom instructions feature #3597

Merged

Conversation

draganjovanovich
Copy link
Collaborator

@draganjovanovich draganjovanovich commented Jul 23, 2023

Added basic functionality of "custom-instructions"

It utilises two additional fields in work_parameters:

  • user_profile (here user would describe what he wants to share with
    llm, for chat session)
  • user_response_instructions (here user would describe how they want llm to
    respond to questions and queries, like format, style, length, etc...)

Here are some of the current UI changes introduced with this PR.

Custom instructions Screenshot 2023-07-23 at 21 46 36 Screenshot 2023-07-23 at 21 46 42 Screenshot 2023-07-23 at 21 47 16 Screenshot 2023-07-23 at 21 48 21 Screenshot 2023-07-23 at 21 48 29

It utilises two additional fields in work_parameters:
- user_profile (here user would describe what he wants to share with
  llm, for chat session)
- user_response_instructions (here user would describe how want to llm
  respond to questions and queries, like format, style, lengt etc...)
It utilises two additional fields in work_parameters:
- user_profile (here user would describe what he wants to share with llm, for chat session)
- user_response_instructions (here user would describe how want to llm respond to questions and queries, like format, style, lengt etc...)
Co-authored-by: Oliver Stanley <olivergestanley@gmail.com>
Copy link
Collaborator

@olliestanley olliestanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inference backend/worker changes lgtm (have not reviewed frontend changes)

Copy link
Collaborator

@notmd notmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run the code yet but overall it looks good. Just one small thing to clean up the code and avoid re-render. Feel free to merge if you can't make it work with react-hook-form.

Comment on lines +114 to +117
const [customInstructions, setCustomInstructions] = useState<CustomInstructionsType>({
user_profile: "",
user_response_instructions: "",
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This state can be handled by react-hook-form. You just need to wrap the CustomInstructions with the Controller component.

Copy link
Collaborator Author

@draganjovanovich draganjovanovich Jul 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, could you please provide a commit/change for that here if you have time and it's small(I am not sure how to wrap it with Controller)?

@draganjovanovich draganjovanovich merged commit 7a68b59 into LAION-AI:main Jul 30, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request inference website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants