Skip to content

Custom instructions feature#3597

Merged
draganjovanovich merged 6 commits into
LAION-AI:mainfrom
draganjovanovich:custom-instructions-feature
Jul 30, 2023
Merged

Custom instructions feature#3597
draganjovanovich merged 6 commits into
LAION-AI:mainfrom
draganjovanovich:custom-instructions-feature

Conversation

@draganjovanovich

@draganjovanovich draganjovanovich commented Jul 23, 2023

Copy link
Copy Markdown
Collaborator

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...)
Comment thread inference/worker/work.py Outdated
Comment thread inference/worker/chat_chain.py Outdated
Comment thread inference/worker/work.py Outdated
Co-authored-by: Oliver Stanley <olivergestanley@gmail.com>

@olliestanley olliestanley left a comment

Copy link
Copy Markdown
Collaborator

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)

@notmd notmd left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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.

@draganjovanovich draganjovanovich Jul 29, 2023

Copy link
Copy Markdown
Collaborator Author

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
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