IAMTFRMZA commited on
Commit
2bb0e5a
·
verified ·
1 Parent(s): 1485585
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -76,6 +76,9 @@ with tab1:
76
  with tab2:
77
  st.subheader("Minutes")
78
 
 
 
 
79
  uploaded_files = st.file_uploader("Upload meeting minutes (PDF/DOCX/Audio)",
80
  type=["pdf", "docx", "mp3", "wav", "m4a"],
81
  accept_multiple_files=True)
@@ -118,12 +121,13 @@ with tab2:
118
  {"role": "user", "content": f"Summarize the following into structured meeting minutes:\n{combined_text}"}
119
  ]
120
  )
121
- minutes = response.choices[0].message.content
122
  st.write("### Meeting Minutes:")
123
- st.text_area("Generated Minutes", minutes, height=300)
124
-
 
125
  doc = Document()
126
- doc.add_paragraph(minutes)
127
 
128
  docx_io = BytesIO()
129
  doc.save(docx_io)
@@ -135,7 +139,7 @@ with tab2:
135
  mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document")
136
 
137
  if st.button("Contract Analysis"):
138
- analysis_prompt = "Analyse this data and provide any insights, risks and relevant data based on the contract that we need to be aware of.\n" + minutes
139
  thread = client.beta.threads.create()
140
  thread_id = thread.id
141
  client.beta.threads.messages.create(
 
76
  with tab2:
77
  st.subheader("Minutes")
78
 
79
+ if "generated_minutes" not in st.session_state:
80
+ st.session_state["generated_minutes"] = ""
81
+
82
  uploaded_files = st.file_uploader("Upload meeting minutes (PDF/DOCX/Audio)",
83
  type=["pdf", "docx", "mp3", "wav", "m4a"],
84
  accept_multiple_files=True)
 
121
  {"role": "user", "content": f"Summarize the following into structured meeting minutes:\n{combined_text}"}
122
  ]
123
  )
124
+ st.session_state["generated_minutes"] = response.choices[0].message.content
125
  st.write("### Meeting Minutes:")
126
+ st.text_area("Generated Minutes", st.session_state["generated_minutes"], height=300)
127
+
128
+ if st.session_state["generated_minutes"]:
129
  doc = Document()
130
+ doc.add_paragraph(st.session_state["generated_minutes"])
131
 
132
  docx_io = BytesIO()
133
  doc.save(docx_io)
 
139
  mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document")
140
 
141
  if st.button("Contract Analysis"):
142
+ analysis_prompt = "Analyse this data and provide any insights, risks and relevant data based on the contract that we need to be aware of.\n" + st.session_state["generated_minutes"]
143
  thread = client.beta.threads.create()
144
  thread_id = thread.id
145
  client.beta.threads.messages.create(