Skip to content

Commit

Permalink
fix truncate lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dayesouza committed Apr 17, 2024
1 parent 3835057 commit 7c8b3ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/workflows/record_matching/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ def att_ui(i):
for i, name in enumerate(unique_names, start=1):
result = result.replace(name, 'Entity_{}'.format(i))

sv.matching_evaluations.value = pl.read_csv(io.StringIO(result), read_csv_options={"truncate_ragged_lines": True})
csv = pl.read_csv(io.StringIO(result))
sv.matching_evaluations.value = csv.drop_nulls()

validation, messages_to_llm = util.ui_components.validate_ai_report(messages, sv.matching_evaluations.value)
sv.matching_report_validation.value = json.loads(validation)
Expand All @@ -366,6 +367,6 @@ def att_ui(i):
obj = json.dumps({
"message": sv.matching_report_validation_messages.value,
"result": sv.matching_report_validation.value,
"report": sv.matching_evaluations.value
"report": pd.DataFrame(sv.matching_evaluations.value).to_json()
}, indent=4)
st.download_button('Download faithfulness evaluation', use_container_width=True, data=str(obj), file_name=f'matching_{get_current_time}_messages.json', mime='text/json')

0 comments on commit 7c8b3ed

Please sign in to comment.