-
Notifications
You must be signed in to change notification settings - Fork 0
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
pipeline for integrating crowdsource prompts #6
Open
sbmaruf
wants to merge
34
commits into
main
Choose a base branch
from
sbmaruf/check_prompts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
01b8112
ignore .DS_Store
sbmaruf fe32003
data stat generator
sbmaruf 76a150b
download data from google sheet.
sbmaruf 8c691a7
update official masakhane/masakhanews
sbmaruf 76a50d4
update jinja prompt loader
sbmaruf 2f1f316
update data source
sbmaruf bbcb487
sanity check of scsqa structure
sbmaruf 3f01f47
adding more datasets and output formatting
sbmaruf bf8f2c0
refactoring
sbmaruf e6488dd
doc string
sbmaruf 7b9f1eb
add metadata
sbmaruf 48244c0
prompt checker pipeline
sbmaruf 0f159f9
type
sbmaruf 2ef6ba1
code formatting & doc string added
sbmaruf a75519a
Add all dataset info
sbmaruf d778277
update naming
sbmaruf a9f210c
add split language
sbmaruf 023b257
Automatic script running
sbmaruf 57c0f32
gitignore updated
sbmaruf 415bb29
formatting issue.
sbmaruf 0529a48
update readme
sbmaruf 29202a0
update --num-proc arg.
sbmaruf 70355f3
ignore dump folder
sbmaruf e9fad7e
update hf-subset info
sbmaruf 3bb89fe
black; 3 letter lang, len(data) condition added
sbmaruf 5e8b4f3
one to one mapping between iso639-2 vs iso639-3
sbmaruf 4c7cc11
runner
sbmaruf 916ba1b
lang dicts added
sbmaruf 4a8b323
script for creating audit data
sbmaruf 31d7e5e
code re-factor
sbmaruf 440b3f1
add help info
sbmaruf 427d9a0
update truncation issue
sbmaruf f907524
cleaning
sbmaruf baf5326
handle exception
sbmaruf 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 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 |
---|---|---|
|
@@ -129,3 +129,4 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
.DS_Store |
This file contains 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,58 @@ | ||
import os | ||
import csv | ||
import json | ||
import argparse | ||
import subprocess | ||
from promptsource.templates import Template | ||
from .data_stat import SERIES_A_DATASET_NAME_DICT | ||
|
||
def check( | ||
json_example, | ||
template_name, | ||
jinja_template, | ||
template_reference=None, | ||
answer_choices=None | ||
): | ||
json_example = json.loads(json_example) | ||
template = Template( | ||
template_name, | ||
jinja_template, | ||
template_reference, | ||
answer_choices=answer_choices | ||
) | ||
lm_io = template.apply(json_example, highlight_variables=False) | ||
return lm_io | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--form_path", | ||
type=str, | ||
default=None, | ||
help="Path of the google sheet." | ||
) | ||
parser.add_argument( | ||
"--overwrite", | ||
action="store_true", | ||
help="Overwrite eexisting prompt file prompts.csv." | ||
) | ||
parser.add_argument( | ||
"--prompt-dir", | ||
type=str, | ||
default="data/", | ||
help="Overwrite eexisting prompt file prompts.csv." | ||
) | ||
args = parser.parse_args() | ||
prompt_file_path = f"{args.prompt_dir}/prompts.csv" | ||
if os.path.exists(prompt_file_path) and args.overwrite: # if file exists, it may be from prev. run/download. | ||
subprocess.check_output(f"mv {prompt_file_path} {prompt_file_path}.old", shell=True) | ||
subprocess.check_output("curl -L https://docs.google.com/spreadsheets/d/10bCwOhM8zKNkqKi54gIvdwrR44YlWQFV9fpGm7acHv8/export?format=csv > ./data/prompts.csv", shell=True) | ||
|
||
with open('data/prompts.csv', 'r') as csvfile: | ||
csvreader = csv.reader(csvfile) | ||
next(iter(csvreader)) | ||
for row in csvreader: | ||
print(row) | ||
|
||
if __name__ == "__main__": | ||
main() |
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.
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.
docstring please :))
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.
Done. But still WIP.