Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ import time
|
|
| 8 |
|
| 9 |
@st.experimental_memo
|
| 10 |
def load_all_usernames():
|
| 11 |
-
filepath = hf_hub_download(repo_id="bigcode/the-stack-username-to-repo", filename="
|
| 12 |
|
| 13 |
with gzip.open(filepath, 'r') as f:
|
| 14 |
usernames = json.loads(f.read().decode('utf-8'))
|
|
@@ -23,23 +23,17 @@ st.markdown("As part of the BigCode project, we released and maintain [The Stack
|
|
| 23 |
st.markdown("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).")
|
| 24 |
|
| 25 |
|
| 26 |
-
t_load = time.time()
|
| 27 |
usernames = load_all_usernames()
|
| 28 |
-
t_load = f"{time.time()-t_load:.2f}"
|
| 29 |
username = st.text_input("Your GitHub Username:")
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
if username or st.button("Check!"):
|
| 34 |
-
t_display = time.time()
|
| 35 |
if username in usernames:
|
| 36 |
repos = usernames[username]
|
| 37 |
repo_word = "repository" if len(repos)==1 else "repositories"
|
| 38 |
st.markdown(f"**Yes**, there is code from **{len(repos)} {repo_word}** in The Stack:")
|
| 39 |
for repo in repos:
|
| 40 |
-
st.markdown(f"`{repo
|
| 41 |
else:
|
| 42 |
-
st.markdown("**No**, your code is not in The Stack.")
|
| 43 |
-
|
| 44 |
-
t_display = f"{time.time()-t_display:.2f}"
|
| 45 |
-
st.markdown(f"_load: {t_load}s, display: {t_display}_")
|
|
|
|
| 8 |
|
| 9 |
@st.experimental_memo
|
| 10 |
def load_all_usernames():
|
| 11 |
+
filepath = hf_hub_download(repo_id="bigcode/the-stack-username-to-repo", filename="username_to_repo.json.gz", repo_type="dataset")
|
| 12 |
|
| 13 |
with gzip.open(filepath, 'r') as f:
|
| 14 |
usernames = json.loads(f.read().decode('utf-8'))
|
|
|
|
| 23 |
st.markdown("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).")
|
| 24 |
|
| 25 |
|
|
|
|
| 26 |
usernames = load_all_usernames()
|
|
|
|
| 27 |
username = st.text_input("Your GitHub Username:")
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
if username or st.button("Check!"):
|
|
|
|
| 32 |
if username in usernames:
|
| 33 |
repos = usernames[username]
|
| 34 |
repo_word = "repository" if len(repos)==1 else "repositories"
|
| 35 |
st.markdown(f"**Yes**, there is code from **{len(repos)} {repo_word}** in The Stack:")
|
| 36 |
for repo in repos:
|
| 37 |
+
st.markdown(f"`{repo}`")
|
| 38 |
else:
|
| 39 |
+
st.markdown("**No**, your code is not in The Stack.")
|
|
|
|
|
|
|
|
|