Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ MAX_SEQUENCE_LENGTH = 500
|
|
79 |
# DATASET_REPO_URL = "https://huggingface.co/datasets/Seetha/Visualization"
|
80 |
# DATA_FILENAME = "level2.json"
|
81 |
#DATA_FILE = os.path.join("data", DATA_FILENAME)
|
82 |
-
DATASET_REPO_URL = "https://huggingface.co/datasets/
|
83 |
DATA_FILENAME = "detailedResults.json"
|
84 |
DATA_FILENAME1 = "level2.json"
|
85 |
|
@@ -519,10 +519,10 @@ def main():
|
|
519 |
'value': int(df_tab.loc[row, col])
|
520 |
})
|
521 |
|
522 |
-
HfApi().delete_file(path_in_repo = DATA_FILENAME1 ,repo_id = '
|
523 |
#st.write('file-deleted')
|
524 |
fs = HfFileSystem(token=HF_TOKEN)
|
525 |
-
with fs.open('datasets/
|
526 |
json.dump(json_data, f)
|
527 |
|
528 |
df_final1.to_csv('predictions.csv')
|
@@ -541,9 +541,9 @@ def main():
|
|
541 |
# # Convert the list of dictionaries to JSON
|
542 |
json_data = json.dumps(data_list)
|
543 |
|
544 |
-
HfApi().delete_file(path_in_repo = DATA_FILENAME ,repo_id = '
|
545 |
#st.write('file2-deleted')
|
546 |
-
with fs.open('datasets/
|
547 |
#data = json.load(fi)
|
548 |
fi.write(json_data)
|
549 |
|
@@ -561,7 +561,7 @@ def main():
|
|
561 |
with st.container():
|
562 |
|
563 |
st.download_button(label="Download the result table",data=buffer,file_name="t2cg_outputs.xlsx",mime="application/vnd.ms-excel")
|
564 |
-
st.markdown('<a href="https://huggingface.co/spaces/
|
565 |
# st.download_button(label="Download the detailed result table_csv",data=csv1,file_name='results.csv',mime='text/csv')
|
566 |
# st.download_button(label="Download the result table_csv",data=csv2,file_name='final_data.csv',mime='text/csv')
|
567 |
|
|
|
79 |
# DATASET_REPO_URL = "https://huggingface.co/datasets/Seetha/Visualization"
|
80 |
# DATA_FILENAME = "level2.json"
|
81 |
#DATA_FILE = os.path.join("data", DATA_FILENAME)
|
82 |
+
DATASET_REPO_URL = "https://huggingface.co/datasets/KGBrain/visual_files"
|
83 |
DATA_FILENAME = "detailedResults.json"
|
84 |
DATA_FILENAME1 = "level2.json"
|
85 |
|
|
|
519 |
'value': int(df_tab.loc[row, col])
|
520 |
})
|
521 |
|
522 |
+
HfApi().delete_file(path_in_repo = DATA_FILENAME1 ,repo_id = 'KGBrain/visual_files',token= HF_TOKEN,repo_type='dataset')
|
523 |
#st.write('file-deleted')
|
524 |
fs = HfFileSystem(token=HF_TOKEN)
|
525 |
+
with fs.open('datasets/KGBrain/visual_files/level2.json', 'w') as f:
|
526 |
json.dump(json_data, f)
|
527 |
|
528 |
df_final1.to_csv('predictions.csv')
|
|
|
541 |
# # Convert the list of dictionaries to JSON
|
542 |
json_data = json.dumps(data_list)
|
543 |
|
544 |
+
HfApi().delete_file(path_in_repo = DATA_FILENAME ,repo_id = 'KGBrain/visual_files',token= HF_TOKEN,repo_type='dataset')
|
545 |
#st.write('file2-deleted')
|
546 |
+
with fs.open('datasets/KGBrain/visual_files/detailedResults.json','w') as fi:
|
547 |
#data = json.load(fi)
|
548 |
fi.write(json_data)
|
549 |
|
|
|
561 |
with st.container():
|
562 |
|
563 |
st.download_button(label="Download the result table",data=buffer,file_name="t2cg_outputs.xlsx",mime="application/vnd.ms-excel")
|
564 |
+
st.markdown('<a href="https://huggingface.co/spaces/KGBrain/visual-knowledgegraph" target="_blank">Click this link in a separate tab to view knowledge graph</a>', unsafe_allow_html=True)
|
565 |
# st.download_button(label="Download the detailed result table_csv",data=csv1,file_name='results.csv',mime='text/csv')
|
566 |
# st.download_button(label="Download the result table_csv",data=csv2,file_name='final_data.csv',mime='text/csv')
|
567 |
|