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

[#27] Add instructions for each category #28

Merged
merged 2 commits into from
Feb 7, 2024
Merged

Conversation

kangsuhyun-yanolja
Copy link
Collaborator

Changes:

  • Extracted functions related to LLM responses to response.py
  • Renamed the "response type" to "category"
  • Added instructions for each category
  • Blocked the submit until the user has selected a category

Fixes #27

Changes:
- Extracted functions related to LLM responses to response.py
- Renamed the "response type" to "category"
- Added instructions for each category
- Blocked the submit until the user has selected a category
Comment on lines +41 to +46
if not category:
raise gr.Error("Please select a category.")

if category == Category.TRANSLATE.value and (not source_lang or
not target_lang):
raise gr.Error("Please select source and target languages.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part is new

Comment on lines +56 to +59
messages=[{
"content": instruction,
"role": "system"
}, {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This message is new

Choose a reason for hiding this comment

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

Hmm this is a chat style but maybe okay for now

response.py Show resolved Hide resolved

# To simulate a stream, we yield each character of the response.
for character in content:
yield character

Choose a reason for hiding this comment

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

no stream please. maybe todo? both responses must arrive together at the same time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll leave TODO and handle it in #29

Comment on lines +56 to +59
messages=[{
"content": instruction,
"role": "system"
}, {

Choose a reason for hiding this comment

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

Hmm this is a chat style but maybe okay for now

@kangsuhyun-yanolja kangsuhyun-yanolja merged commit 34c6b56 into main Feb 7, 2024
@kangsuhyun-yanolja kangsuhyun-yanolja deleted the 27-instruction branch February 7, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add predefined instructions for task categories
2 participants