jskinner215 commited on
Commit
072f6c1
·
1 Parent(s): d133a84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -29,23 +29,21 @@ def ask_llm_chunk(chunk, questions):
29
  answers = []
30
  for coordinates in predicted_answer_coordinates:
31
  if len(coordinates) == 1:
32
- # Debugging lines
33
- st.write(f"DataFrame shape: {chunk.shape}")
34
- st.write(f"DataFrame columns: {chunk.columns}")
35
- st.write(f"Trying to access row {coordinates[0][0]}, col {coordinates[0][1]}")
36
- st.write(f"Testing DataFrame iloc: {chunk.iloc[coordinates[0][0], coordinates[0][1]]}")
37
-
38
-
39
  row, col = coordinates[0]
40
  try:
 
 
 
41
  value = chunk.iloc[row, col]
 
42
  if isinstance(value, pd.Series):
43
  answers.append(value.values)
44
  else:
45
  answers.append(value.item() if hasattr(value, 'item') else value)
46
  except Exception as e:
47
- st.write(f"An error occurred: {e}")
48
- answers.append("Error")
 
49
  else:
50
  cell_values = []
51
  for coordinate in coordinates:
 
29
  answers = []
30
  for coordinates in predicted_answer_coordinates:
31
  if len(coordinates) == 1:
 
 
 
 
 
 
 
32
  row, col = coordinates[0]
33
  try:
34
+ st.write(f"DataFrame shape: {chunk.shape}") # Debugging line
35
+ st.write(f"DataFrame columns: {chunk.columns}") # Debugging line
36
+ st.write(f"Trying to access row {row}, col {col}") # Debugging line
37
  value = chunk.iloc[row, col]
38
+ st.write(f"Value accessed: {value}") # New debugging line
39
  if isinstance(value, pd.Series):
40
  answers.append(value.values)
41
  else:
42
  answers.append(value.item() if hasattr(value, 'item') else value)
43
  except Exception as e:
44
+ st.write(f"Exception type: {type(e)}") # New debugging line
45
+ st.write(f"Exception args: {e.args}") # New debugging line
46
+ st.write(f"An error occurred: {e}") # Existing debugging line
47
  else:
48
  cell_values = []
49
  for coordinate in coordinates: