anmolsahai commited on
Commit
1dd0ce9
1 Parent(s): a63e9b0
__pycache__/langchain_pipeline.cpython-310.pyc CHANGED
Binary files a/__pycache__/langchain_pipeline.cpython-310.pyc and b/__pycache__/langchain_pipeline.cpython-310.pyc differ
 
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- from langchain_pipeline import pipeline, model_names
3
 
4
  st.title("Canarie AI Prototype")
5
  st.subheader("Finding the canarie in the coal mine")
@@ -35,10 +35,9 @@ min_transaction_overdraft = st.number_input(
35
 
36
  uploaded_file = st.file_uploader("Choose a file")
37
  if uploaded_file is not None:
38
- diff = ""
39
  with st.spinner('Please wait ...'):
40
  try:
41
- diff = pipeline(
42
  uploaded_file,
43
  model_name,
44
  balance_type,
@@ -47,39 +46,13 @@ if uploaded_file is not None:
47
  min_overdrawn_fee,
48
  min_transaction_overdraft
49
  )
 
 
 
 
 
 
 
 
50
  except Exception as e:
51
  st.exception(e)
52
-
53
- diff_lines = diff.split("\n")
54
-
55
- styled_diff = """
56
- <style>
57
- body {
58
- font-family: 'Times New Roman', serif;
59
- line-height: 1.5;
60
- }
61
- .diff {
62
- margin: 10px 0;
63
- padding: 5px;
64
- }
65
- .add {
66
- color: green;
67
- }
68
- .remove {
69
- color: red;
70
- }
71
- </style>
72
- <div>
73
- """
74
- for line in diff_lines:
75
- if line.startswith('+'):
76
- styled_diff += f'<div class="diff add">{line}</div>'
77
- elif line.startswith('-'):
78
- styled_diff += f'<div class="diff remove">{line}</div>'
79
- else:
80
- styled_diff += f'<div class="diff">{line}</div>'
81
- styled_diff += "</div>"
82
-
83
- st.markdown(styled_diff, unsafe_allow_html=True)
84
-
85
- st.markdown("The key changes are:")
 
1
  import streamlit as st
2
+ from combined_pipeline import pipeline, model_names
3
 
4
  st.title("Canarie AI Prototype")
5
  st.subheader("Finding the canarie in the coal mine")
 
35
 
36
  uploaded_file = st.file_uploader("Choose a file")
37
  if uploaded_file is not None:
 
38
  with st.spinner('Please wait ...'):
39
  try:
40
+ output_path = pipeline(
41
  uploaded_file,
42
  model_name,
43
  balance_type,
 
46
  min_overdrawn_fee,
47
  min_transaction_overdraft
48
  )
49
+ st.success(f"Redlined document saved to {output_path}")
50
+ with open(output_path, "rb") as file:
51
+ st.download_button(
52
+ label="Download Redlined Document",
53
+ data=file,
54
+ file_name="Redlined_Reg_E_Notice.docx",
55
+ mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
56
+ )
57
  except Exception as e:
58
  st.exception(e)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
langchain_pipeline.py CHANGED
The diff for this file is too large to render. See raw diff
 
requirements.txt CHANGED
@@ -6,6 +6,8 @@ langchain_astradb
6
  langchain_core
7
  langchain_openai
8
  langchain_anthropic
9
- langchain_google_genai
10
  google_generativeai
11
- langchain-google-genai==1.0.5
 
 
 
6
  langchain_core
7
  langchain_openai
8
  langchain_anthropic
9
+ langchain_google_genai==1.0.5
10
  google_generativeai
11
+ pdf2docx
12
+ pymupdf
13
+ python-docx