Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def transcribe(asr_inputs, task):
|
|
122 |
# Profile Interface functions
|
123 |
def load_profiles():
|
124 |
try:
|
125 |
-
return pd.read_csv("temp_profiles.csv")
|
126 |
except FileNotFoundError:
|
127 |
return pd.DataFrame()
|
128 |
|
@@ -139,9 +139,13 @@ def lookup_profile(assessment_id_input):
|
|
139 |
if not assessment_id:
|
140 |
#state.update("Please enter an Assessment ID", color="red")
|
141 |
return "No Assessment Object/Session ID provided!"
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
145 |
else:
|
146 |
#state.update("No profiles found for this ID", color="red")
|
147 |
return "No matched profile found!"
|
|
|
122 |
# Profile Interface functions
|
123 |
def load_profiles():
|
124 |
try:
|
125 |
+
return pd.read_csv("temp_profiles.csv", index_col=False)
|
126 |
except FileNotFoundError:
|
127 |
return pd.DataFrame()
|
128 |
|
|
|
139 |
if not assessment_id:
|
140 |
#state.update("Please enter an Assessment ID", color="red")
|
141 |
return "No Assessment Object/Session ID provided!"
|
142 |
+
|
143 |
+
result = df[df.Assessment_ID == assessment_id]
|
144 |
+
if result.empty:
|
145 |
+
if isinstance(data, pd.DataFrame):
|
146 |
+
return result.to_html()
|
147 |
+
elif isinstance(data, pd.Series):
|
148 |
+
return result.to_frame().to_html()
|
149 |
else:
|
150 |
#state.update("No profiles found for this ID", color="red")
|
151 |
return "No matched profile found!"
|