-
Notifications
You must be signed in to change notification settings - Fork 186
Improving Transform and Rerank Module #396
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
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
509f5d9
add top_dataset_info_return
saum7800 90a4a04
make reranking call from 16k context
saum7800 7193ec0
add incontext and COT to dataset transformation
saum7800 1ae1b0d
log selected columns
saum7800 71e129b
add peft training
saum7800 faa5b7b
remove import
saum7800 c0e6ef6
two returns
saum7800 9e40238
create promptspec
saum7800 f4298b8
add logging
saum7800 9c9fa75
add logging
saum7800 665b546
add logging
saum7800 e18989a
pass text
saum7800 5d9761e
change params
saum7800 b5f094f
change params
saum7800 1e169eb
change params
saum7800 bf72344
change params
saum7800 758a6da
change paths
saum7800 7bfa104
minor changes
saum7800 9e9f33e
remove arg
saum7800 a12e062
clear cache
saum7800 d9dc1ab
add wandb changes and minor changes
saum7800 63a4a75
change eval steps
saum7800 931edf0
change eval steps
saum7800 a2c2cc6
modify qlora params
saum7800 41d6fd0
make lr changes
saum7800 d32dc22
curr changes
ritugala 5a93ae7
delete saumya changes
ritugala 921a98f
initial changes
ritugala 88130ba
merging changes
ritugala 379a503
first pass refactoring
ritugala acd6e7a
minor bug fixing
ritugala 415aa21
added docstrings
ritugala 0d009b2
completed precommit hooks
ritugala 60051a7
minor refactoring fixes
ritugala e0c0d0f
fixing pytests
ritugala 6558279
updated p2m_demo.py
ritugala 15a61eb
fix linting
ritugala 775da63
PR changes
ritugala ad0d502
comment change
ritugala 4b6427b
merged with main
ritugala 95dcea0
PR changes and fixed test
ritugala b92dca2
fixed linting
ritugala 423510e
Update prompt2model/dataset_retriever/description_dataset_retriever.py
ritugala 92f127a
Update prompt2model/utils/parse_responses.py
ritugala 547d4a3
Update prompt2model/dataset_retriever/description_dataset_retriever.py
ritugala c2ba8b3
Update prompt2model/dataset_retriever/description_dataset_retriever.py
ritugala 0c81d18
fixed minor linting
ritugala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
examples/huggingface_data/huggingface_datasets/dataset_index.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
examples/huggingface_data/huggingface_datasets/reranking_dataset_index.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-7.31 MB
huggingface_data/huggingface_datasets/huggingface_datasets_datafinder_index
Binary file not shown.
297 changes: 233 additions & 64 deletions
297
prompt2model/dataset_retriever/description_dataset_retriever.py
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""This module contains the functions to construct the prompt for task expansion.""" | ||
METAPROMPT_BASE = "Carefully analyse the task description and examples of the task, and explain the task to give a clearer description. Do not explain each example, but rather capture the general trends. Also place special focus on the format of the input/output examples." # noqa: E501 | ||
|
||
TASK = """ | ||
Task Description: {task_description} | ||
|
||
Task Examples: {examples} | ||
""" | ||
|
||
|
||
def construct_prompt_for_task_explanation(instruction: str, demonstrations: str): | ||
"""Constructs prompt for task explanation. | ||
|
||
This is useful for clarifying the requirements of a task, | ||
and providing a clearer description of the task. | ||
|
||
Args: | ||
instruction (str): The task instruction. | ||
demonstrations (str): The task demonstrations. | ||
|
||
Returns: | ||
str: The constructed prompt. | ||
""" | ||
task = TASK.format(task_description=instruction, examples=demonstrations) | ||
prompt = "\n--------\n".join([METAPROMPT_BASE, task]) | ||
return prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.