Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,15 @@ import streamlit as st
|
|
6 |
from PIL import Image
|
7 |
from functools import partial
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
def set_query(q: str):
|
10 |
st.session_state.messages.append({"role": "user", "content": q})
|
11 |
if st.session_state.cfg.streaming:
|
@@ -19,14 +28,8 @@ def set_query(q: str):
|
|
19 |
st.session_state.messages.append(message)
|
20 |
|
21 |
|
|
|
22 |
def launch_bot():
|
23 |
-
def generate_response(question):
|
24 |
-
response = vq.submit_query(question)
|
25 |
-
return response
|
26 |
-
|
27 |
-
def generate_streaming_response(question):
|
28 |
-
response = vq.submit_query_streaming(question)
|
29 |
-
return response
|
30 |
|
31 |
if 'cfg' not in st.session_state:
|
32 |
corpus_ids = str(os.environ['corpus_ids']).split(',')
|
|
|
6 |
from PIL import Image
|
7 |
from functools import partial
|
8 |
|
9 |
+
def generate_response(question):
|
10 |
+
response = st.session_state.vq.submit_query(question)
|
11 |
+
return response
|
12 |
+
|
13 |
+
def generate_streaming_response(question):
|
14 |
+
response = st.session_state.vq.submit_query_streaming(question)
|
15 |
+
return response
|
16 |
+
|
17 |
+
|
18 |
def set_query(q: str):
|
19 |
st.session_state.messages.append({"role": "user", "content": q})
|
20 |
if st.session_state.cfg.streaming:
|
|
|
28 |
st.session_state.messages.append(message)
|
29 |
|
30 |
|
31 |
+
|
32 |
def launch_bot():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
if 'cfg' not in st.session_state:
|
35 |
corpus_ids = str(os.environ['corpus_ids']).split(',')
|