MadMarx37 commited on
Commit
2872e0f
·
verified ·
1 Parent(s): 6a18089

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1,6 +1,10 @@
1
  import requests
2
  import streamlit as st
3
  from together import Together
 
 
 
 
4
 
5
  # Initialize Together AI client
6
  client = Together(api_key=st.secrets["TOGETHER_API_KEY"])
@@ -53,7 +57,7 @@ if st.session_state.uploaded_file is not None:
53
  # Only call the API if we don't have analysis results yet
54
  if st.session_state.analysis_results is None:
55
  files = {"file": st.session_state.uploaded_file}
56
- response = requests.post("http://35.172.179.19:5002/upload", files=files)
57
  if response.status_code == 200:
58
  st.write("Contract uploaded successfully. Analyzing...")
59
  st.session_state.analysis_results = response.json()
@@ -110,4 +114,4 @@ if st.session_state.uploaded_file is not None:
110
  st.success("Contract negotiation completed. Response generated for review.")
111
 
112
  else:
113
- st.write("Please upload a contract to begin the analysis.")
 
1
  import requests
2
  import streamlit as st
3
  from together import Together
4
+ import os
5
+ from dotenv import load_dotenv
6
+
7
+ load_dotenv()
8
 
9
  # Initialize Together AI client
10
  client = Together(api_key=st.secrets["TOGETHER_API_KEY"])
 
57
  # Only call the API if we don't have analysis results yet
58
  if st.session_state.analysis_results is None:
59
  files = {"file": st.session_state.uploaded_file}
60
+ response = requests.post("http://localhost:5002/upload", files=files)
61
  if response.status_code == 200:
62
  st.write("Contract uploaded successfully. Analyzing...")
63
  st.session_state.analysis_results = response.json()
 
114
  st.success("Contract negotiation completed. Response generated for review.")
115
 
116
  else:
117
+ st.write("Please upload a contract to begin the analysis.")