Commit
·
3096d19
1
Parent(s):
e1db4b2
Update app.py
Browse files
app.py
CHANGED
@@ -337,12 +337,13 @@ def add_certified_user(hf_username, first_name, last_name, pass_percentage):
|
|
337 |
# Check if this hf_username is already in our dataset:
|
338 |
check = history.loc[history['hf_username'] == hf_username]
|
339 |
if not check.empty:
|
340 |
-
print("CHECK", check)
|
341 |
-
print("INDEX", check.index[0])
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
|
|
346 |
|
347 |
history.to_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME), index=False)
|
348 |
repo.push_to_hub(commit_message="Update certified users list")
|
|
|
337 |
# Check if this hf_username is already in our dataset:
|
338 |
check = history.loc[history['hf_username'] == hf_username]
|
339 |
if not check.empty:
|
340 |
+
#print("CHECK", check)
|
341 |
+
#print("INDEX", check.index[0])
|
342 |
+
data = data.drop(labels=check.index[0], axis=0)
|
343 |
+
#history.iloc[[check.index[0]],['hf_username', 'first_name', 'last_name', 'pass_percentage', 'datetime']] = hf_username, first_name, last_name, pass_percentage, time.time()
|
344 |
+
|
345 |
+
new_row = pd.DataFrame({'hf_username': hf_username, 'first_name': first_name, 'last_name': last_name, 'pass_percentage': pass_percentage, 'datetime': time.time()}, index=[0])
|
346 |
+
history = pd.concat([new_row, history[:]]).reset_index(drop=True)
|
347 |
|
348 |
history.to_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME), index=False)
|
349 |
repo.push_to_hub(commit_message="Update certified users list")
|