Spaces:
Sleeping
Sleeping
Ashmi Banerjee
commited on
Commit
·
64656b5
1
Parent(s):
c7dea7e
update data
Browse files
app.py
CHANGED
|
@@ -84,6 +84,7 @@ def reset_survey():
|
|
| 84 |
st.session_state.completed = True
|
| 85 |
st.session_state.start_new_survey = True
|
| 86 |
|
|
|
|
| 87 |
def load_data():
|
| 88 |
try:
|
| 89 |
data = pd.read_csv("data/gemini_results_subset.csv")[:5]
|
|
@@ -91,6 +92,7 @@ def load_data():
|
|
| 91 |
except Exception as e:
|
| 92 |
repo_name = os.getenv("DATA_REPO")
|
| 93 |
data_files = os.getenv("LLAMA_DATA_FILES")
|
|
|
|
| 94 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 95 |
dataset = load_dataset(repo_name, token=True, data_files=data_files)
|
| 96 |
dataset.set_format(type='pandas') ## converting it into pandas
|
|
@@ -119,7 +121,7 @@ def ui():
|
|
| 119 |
continue_survey_screen(data)
|
| 120 |
else:
|
| 121 |
if st.session_state.current_index >= len(data):
|
| 122 |
-
|
| 123 |
print("survey completed")
|
| 124 |
survey_completed()
|
| 125 |
# Otherwise, show questions from where they left off
|
|
|
|
| 84 |
st.session_state.completed = True
|
| 85 |
st.session_state.start_new_survey = True
|
| 86 |
|
| 87 |
+
|
| 88 |
def load_data():
|
| 89 |
try:
|
| 90 |
data = pd.read_csv("data/gemini_results_subset.csv")[:5]
|
|
|
|
| 92 |
except Exception as e:
|
| 93 |
repo_name = os.getenv("DATA_REPO")
|
| 94 |
data_files = os.getenv("LLAMA_DATA_FILES")
|
| 95 |
+
print("data_files", data_files)
|
| 96 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 97 |
dataset = load_dataset(repo_name, token=True, data_files=data_files)
|
| 98 |
dataset.set_format(type='pandas') ## converting it into pandas
|
|
|
|
| 121 |
continue_survey_screen(data)
|
| 122 |
else:
|
| 123 |
if st.session_state.current_index >= len(data):
|
| 124 |
+
# If all questions have been answered, show the exit screen
|
| 125 |
print("survey completed")
|
| 126 |
survey_completed()
|
| 127 |
# Otherwise, show questions from where they left off
|