Skip to content

Add more examples for few-shot learning #16

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

Merged
merged 5 commits into from
Sep 8, 2024
Merged

Conversation

ishikawa
Copy link
Owner

@ishikawa ishikawa commented Sep 8, 2024

This PR enhances the few-shot learning capabilities of our project by adding more example outputs and implementing a parsing mechanism for these examples.

Key changes:

  • Added new example PR outputs in Markdown format (sum_diff/examples/001.md, 002.md, and 003.md)
  • Implemented parse_pr_example function in sum_diff/utils.py to process example PR outputs
  • Updated main function in sum_diff/__init__.py to incorporate example outputs into the user prompt
  • Added unit tests for the parse_pr_example function in tests/test_utils.py
  • Updated pyproject.toml to include pytest configuration and dev dependencies

The new examples provide a diverse set of PR formats, including different styles and complexities. This will help improve the quality and variety of generated PR titles and descriptions.

The parse_pr_example function extracts the title and description from the Markdown-formatted example files, handling HTML comments and multiple headings. This parsed data is then incorporated into the user prompt, allowing for more effective few-shot learning.

Example usage of the new parse_pr_example function:

from sum_diff.utils import parse_pr_example

markdown_content = """
<!-- This is a comment -->
# Example PR Title

This is the PR description.
"""

pr_example = parse_pr_example(markdown_content)
print(pr_example.title)  # Output: Example PR Title
print(pr_example.description)  # Output: This is the PR description.

These changes will enhance the AI model's ability to generate more accurate and contextually appropriate PR titles and descriptions based on the provided examples.

This commit adds a new command-line option `--lang` to the `main()` function. Users can now choose the output language between English (default) and Japanese.

Key changes:
- Implemented the `click.option` decorator to add the language selection option
- Supported language choices are "en" for English and "ja" for Japanese

This option enables easy internationalization and lays the foundation for multilingual support, including Japanese. The code structure can be leveraged for adding support for other languages in the future.
This change introduces the option to perform local storage writes asynchronously in the raft module. By using a message-passing interface instead of the default Ready/Advance call, this feature reduces commit latency and increases throughput.

Key changes:
- Added the AsyncStorageWrites option to the raft node
- Processed MsgStorageAppend and MsgStorageApply messages in LocalAppendThread and LocalApplyThread
- Ensured order processing for messages to the same target

This enhancement provides improved performance for storage operations while maintaining backward compatibility. It allows users to opt-in to asynchronous storage writes, resulting in reduced interference and increased batching of log appends and state machine applications.
@ishikawa ishikawa merged commit 5ef49bd into main Sep 8, 2024
@ishikawa ishikawa deleted the more-examles-for-few-shots branch September 8, 2024 02:09
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.

1 participant