Spaces:
Build error
Build error
Update app.py
Browse files2 unmodified lines3456789101112131415161718192 unmodified lines22232425262728293031322 unmodified linesfrom huggingface_hub import Repositoryimport osfrom pathlib import Pathimport csv# assign directoryauth_token = os.environ.get("space_to_dataset") or True#data = pd.read_csv("test.csv")#for line in data:# st.write(line)title = st.text_input('Movie title', 'Life of Brian')if st.button('Submit'):new_row = title2 unmodified lines# st.write(os.getcwd())# data.to_csv('test.csv', index= False)DATASET_REPO_URL = 'ppsingh/annotation_data'DATA_FILENAME = "test.csv"DATA_FILE = os.path.join("data", DATA_FILENAME)repo = Repository( local_dir="data", clone_from=DATASET_REPO_URL, repo_type="dataset", use_auth_token= auth_token)df = pd.read_csv('data/test.csv')st.write(df)# st.write('data/test.csv')# iterate over files in2 unmodified lines3456789101112131415161718192021222324252627282930313233342 unmodified lines373839404142432 unmodified linesfrom huggingface_hub import Repositoryimport osfrom pathlib import Pathimport json# Declaring the variables for later use to talk to dataset# the token is saved as secret key-value pair in the environment which can be access as shown belowauth_token = os.environ.get("space_to_dataset") or TrueDATASET_REPO_URL = 'ppsingh/annotation_data' # path to dataset repoDATA_FILENAME = "paralist.json"DATA_FILE = os.path.join("data", DATA_FILENAME)# cloning the dataset reporepo = Repository( local_dir="data", clone_from=DATASET_REPO_URL, repo_type="dataset", use_auth_token= auth_token)#data = pd.read_csv("test.csv")#for line in data:st.sidebar.markdown("""# Data Annotation DemoThis app is demo how to use the space to provide user interface for the data annotation/tagging. The data resides in repo_type 'dataset'.""")# st.write(line)title = st.text_input('Movie title', 'Life of Brian')if st.button('Submit'):new_row = title2 unmodified lines# st.write(os.getcwd())# data.to_csv('test.csv', index= False)st.write(df)# st.write('data/test.csv')# iterate over files in
app.py+21-10