Spaces:
Build error
Build error
opt-out link
Browse files
app.py
CHANGED
|
@@ -26,6 +26,29 @@ As part of the BigCode project, we released and maintain [The Stack](https://hug
|
|
| 26 |
This tool lets you check if a repository under a given username is part of The Stack dataset. Would you like to have your data removed from future versions of The Stack? You can opt-out following the instructions [here](https://www.bigcode-project.org/docs/about/the-stack/#how-can-i-request-that-my-data-be-removed-from-the-stack).
|
| 27 |
"""
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
def check_username(username, version):
|
| 30 |
output_md = ""
|
| 31 |
if username in usernames[version] and len(usernames[version][username])>0:
|
|
@@ -36,7 +59,7 @@ def check_username(username, version):
|
|
| 36 |
output_md += f"_{repo}_\n\n"
|
| 37 |
else:
|
| 38 |
output_md += "**No**, your code is not in The Stack."
|
| 39 |
-
return output_md.strip()
|
| 40 |
|
| 41 |
with gr.Blocks() as demo:
|
| 42 |
with gr.Row():
|
|
@@ -48,8 +71,10 @@ with gr.Blocks() as demo:
|
|
| 48 |
check_button = gr.Button("Check!")
|
| 49 |
|
| 50 |
repos = gr.Markdown()
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
check_button.click(check_username, [username, version], repos)
|
| 53 |
|
| 54 |
|
| 55 |
demo.launch()
|
|
|
|
| 26 |
This tool lets you check if a repository under a given username is part of The Stack dataset. Would you like to have your data removed from future versions of The Stack? You can opt-out following the instructions [here](https://www.bigcode-project.org/docs/about/the-stack/#how-can-i-request-that-my-data-be-removed-from-the-stack).
|
| 27 |
"""
|
| 28 |
|
| 29 |
+
opt_out_text_template = """\
|
| 30 |
+
If you want your data to be removed from the stack and model training open an issue with [this link](https://github.com/bigcode-project/opt-out/issues/new?title={title}&body={body}).\
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
opt_out_issue_title = """Opt-out request for {username}"""
|
| 34 |
+
opt_out_issue_body = """\
|
| 35 |
+
I request that the following data is removed from The Stack:
|
| 36 |
+
|
| 37 |
+
- Commits
|
| 38 |
+
- GitHub issue
|
| 39 |
+
{repo_lis}
|
| 40 |
+
|
| 41 |
+
_Note_: If you don't want all resources to be included just remove the elements from the list above.
|
| 42 |
+
"""
|
| 43 |
+
|
| 44 |
+
def issue_url(username, repos):
|
| 45 |
+
title = opt_out_issue_title.format(username=username)
|
| 46 |
+
body = opt_out_issue_body.format(repo_list=" - "+ "\n - ".join(repos))
|
| 47 |
+
|
| 48 |
+
opt_out_text = opt_out_text_template.format(title=title, body=body)
|
| 49 |
+
|
| 50 |
+
return opt_out_text
|
| 51 |
+
|
| 52 |
def check_username(username, version):
|
| 53 |
output_md = ""
|
| 54 |
if username in usernames[version] and len(usernames[version][username])>0:
|
|
|
|
| 59 |
output_md += f"_{repo}_\n\n"
|
| 60 |
else:
|
| 61 |
output_md += "**No**, your code is not in The Stack."
|
| 62 |
+
return output_md.strip(), issue_url(username, repos)
|
| 63 |
|
| 64 |
with gr.Blocks() as demo:
|
| 65 |
with gr.Row():
|
|
|
|
| 71 |
check_button = gr.Button("Check!")
|
| 72 |
|
| 73 |
repos = gr.Markdown()
|
| 74 |
+
opt_out = gr.Markdown()
|
| 75 |
+
|
| 76 |
|
| 77 |
+
check_button.click(check_username, [username, version], [repos, opt_out])
|
| 78 |
|
| 79 |
|
| 80 |
demo.launch()
|