Spaces:
Sleeping
Sleeping
AarushiGupta28
commited on
Commit
•
2af0793
1
Parent(s):
0ae6af3
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
import random
|
3 |
import time
|
4 |
-
import
|
5 |
-
|
6 |
# Streamed response emulator
|
7 |
def response_generator(p1):
|
8 |
print(p1)
|
9 |
-
response = str(
|
|
|
10 |
# return response
|
11 |
for word in response.split("\n"):
|
12 |
yield word + " " + "\n"
|
@@ -35,4 +35,5 @@ if prompt := st.chat_input("What is up?"):
|
|
35 |
with st.chat_message("assistant"):
|
36 |
response = st.write_stream(response_generator(prompt))
|
37 |
# Add assistant response to chat history
|
38 |
-
st.session_state.messages.append({"role": "assistant", "content": response})
|
|
|
|
1 |
import streamlit as st
|
2 |
import random
|
3 |
import time
|
4 |
+
from app_server import res
|
|
|
5 |
# Streamed response emulator
|
6 |
def response_generator(p1):
|
7 |
print(p1)
|
8 |
+
response = str(res(p1))
|
9 |
+
#response = str(st.session_state.res(p1))
|
10 |
# return response
|
11 |
for word in response.split("\n"):
|
12 |
yield word + " " + "\n"
|
|
|
35 |
with st.chat_message("assistant"):
|
36 |
response = st.write_stream(response_generator(prompt))
|
37 |
# Add assistant response to chat history
|
38 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
39 |
+
|