Spaces:
Runtime error
Runtime error
Updating to two login tokens, one for read and one for write
Browse files
Home.py
CHANGED
@@ -410,8 +410,6 @@ def feedback():
|
|
410 |
from huggingface_hub import login
|
411 |
import datasets
|
412 |
|
413 |
-
login(token=st.secrets.hug_key)
|
414 |
-
|
415 |
st.subheader('Leave comments below')
|
416 |
|
417 |
with st.form('feed',clear_on_submit=True):
|
@@ -419,12 +417,14 @@ def feedback():
|
|
419 |
sub = st.form_submit_button('Submit')
|
420 |
|
421 |
if sub:
|
422 |
-
|
|
|
423 |
f_csv = f_f.to_csv()
|
424 |
f_s = pd.Series(f)
|
425 |
f_f = f_f.append(f_s, ignore_index=True)
|
426 |
f_w = datasets.Dataset.from_csv(f_f)
|
427 |
-
|
|
|
428 |
|
429 |
|
430 |
with tab1:
|
|
|
410 |
from huggingface_hub import login
|
411 |
import datasets
|
412 |
|
|
|
|
|
413 |
st.subheader('Leave comments below')
|
414 |
|
415 |
with st.form('feed',clear_on_submit=True):
|
|
|
417 |
sub = st.form_submit_button('Submit')
|
418 |
|
419 |
if sub:
|
420 |
+
login(token=st.secrets.read_hug)
|
421 |
+
f_f = datasets.load_dataset('AutoBG/AutoBG-Data/feedback.csv')
|
422 |
f_csv = f_f.to_csv()
|
423 |
f_s = pd.Series(f)
|
424 |
f_f = f_f.append(f_s, ignore_index=True)
|
425 |
f_w = datasets.Dataset.from_csv(f_f)
|
426 |
+
login(token=st.secrets.write_hug)
|
427 |
+
f_w.save_to_disk('AutoBG/AutoBG-Data/feedback.csv')
|
428 |
|
429 |
|
430 |
with tab1:
|