Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -7,6 +7,7 @@ from tqdm.auto import tqdm
|
|
| 7 |
import streamlit as st
|
| 8 |
from huggingface_hub import Repository, HfApi, HfFolder
|
| 9 |
import os
|
|
|
|
| 10 |
tqdm.pandas()
|
| 11 |
|
| 12 |
api = HfApi()
|
|
@@ -45,9 +46,10 @@ def addToCsvAndTrain(trainset, old_df):
|
|
| 45 |
neues_df = pd.DataFrame(trainset, columns= data.columns)
|
| 46 |
df = pd.concat([old_df, neues_df], ignore_index=True)
|
| 47 |
df.to_csv(f'{localdir}/top50.csv', index=False, encoding='utf-8')
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
|
|
|
|
| 7 |
import streamlit as st
|
| 8 |
from huggingface_hub import Repository, HfApi, HfFolder
|
| 9 |
import os
|
| 10 |
+
import random
|
| 11 |
tqdm.pandas()
|
| 12 |
|
| 13 |
api = HfApi()
|
|
|
|
| 46 |
neues_df = pd.DataFrame(trainset, columns= data.columns)
|
| 47 |
df = pd.concat([old_df, neues_df], ignore_index=True)
|
| 48 |
df.to_csv(f'{localdir}/top50.csv', index=False, encoding='utf-8')
|
| 49 |
+
if(random.randint(1, 10) == 7):
|
| 50 |
+
repo.git_add(os.path.abspath(f'{localdir}/top50.csv'))
|
| 51 |
+
repo.git_commit("Add top50.csv")
|
| 52 |
+
repo.git_push()
|
| 53 |
|
| 54 |
|
| 55 |
|