Spaces:
Running
Running
Samarth Goel
commited on
Commit
·
04a08d3
1
Parent(s):
aa1b98f
finalize streamlit
Browse files
app.py
CHANGED
@@ -74,8 +74,7 @@ def main():
|
|
74 |
st.warning("Please upload a document.")
|
75 |
return
|
76 |
|
77 |
-
|
78 |
-
full_prompt = prompt
|
79 |
|
80 |
if model == "GPT-4o":
|
81 |
with st.spinner("Processing with GPT-4o..."):
|
@@ -91,9 +90,7 @@ def main():
|
|
91 |
for chunk in stream:
|
92 |
if chunk.choices[0].delta.content is not None:
|
93 |
full_response += chunk.choices[0].delta.content
|
94 |
-
response_area.
|
95 |
-
"Response:", value=full_response, height=300
|
96 |
-
)
|
97 |
|
98 |
elif model == "Claude 3.5 Sonnet":
|
99 |
with st.spinner("Processing with Claude 3.5 Sonnet..."):
|
@@ -107,9 +104,7 @@ def main():
|
|
107 |
|
108 |
for text in stream.text_stream:
|
109 |
full_response += text
|
110 |
-
response_area.
|
111 |
-
"Response:", value=full_response, height=300
|
112 |
-
)
|
113 |
|
114 |
|
115 |
if __name__ == "__main__":
|
|
|
74 |
st.warning("Please upload a document.")
|
75 |
return
|
76 |
|
77 |
+
full_prompt = f"Document content:\n\n{document_text}\n\nPrompt:\n\n{prompt}"
|
|
|
78 |
|
79 |
if model == "GPT-4o":
|
80 |
with st.spinner("Processing with GPT-4o..."):
|
|
|
90 |
for chunk in stream:
|
91 |
if chunk.choices[0].delta.content is not None:
|
92 |
full_response += chunk.choices[0].delta.content
|
93 |
+
response_area.markdown(f"**Response:**\n\n{full_response}")
|
|
|
|
|
94 |
|
95 |
elif model == "Claude 3.5 Sonnet":
|
96 |
with st.spinner("Processing with Claude 3.5 Sonnet..."):
|
|
|
104 |
|
105 |
for text in stream.text_stream:
|
106 |
full_response += text
|
107 |
+
response_area.markdown(f"**Response:**\n\n{full_response}")
|
|
|
|
|
108 |
|
109 |
|
110 |
if __name__ == "__main__":
|