-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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
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.") |
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.
This part is new
messages=[{ | ||
"content": instruction, | ||
"role": "system" | ||
}, { |
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.
This message is new
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.
Hmm this is a chat style but maybe okay for now
|
||
# To simulate a stream, we yield each character of the response. | ||
for character in content: | ||
yield character |
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.
no stream please. maybe todo? both responses must arrive together at the same time
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.
I'll leave TODO and handle it in #29
messages=[{ | ||
"content": instruction, | ||
"role": "system" | ||
}, { |
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.
Hmm this is a chat style but maybe okay for now
Changes:
Fixes #27