Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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://
|
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.")
|