Update app.py
Browse files
app.py
CHANGED
@@ -41,28 +41,28 @@ def launch_bot():
|
|
41 |
return False
|
42 |
|
43 |
if 'cfg' not in st.session_state:
|
44 |
-
corpus_keys = ["first
|
45 |
cfg = OmegaConf.create({
|
46 |
-
|
47 |
-
|
48 |
'title': os.environ['title'],
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
})
|
55 |
-
st.session_state.cfg = cfg
|
56 |
-
st.session_state.ex_prompt = None
|
57 |
-
st.session_state.first_turn = True
|
58 |
-
st.session_state.language = cfg.language
|
59 |
-
example_messages = [example.strip() for example in cfg.examples.split(",")]
|
60 |
-
st.session_state.example_messages = [em for em in example_messages if len(em)>0][:max_examples]
|
61 |
|
62 |
-
st.session_state.vq = VectaraQuery(cfg.api_key, cfg.corpus_keys, cfg.prompt_name)
|
63 |
|
64 |
cfg = st.session_state.cfg
|
65 |
-
vq = st.session_state.vq
|
66 |
st.set_page_config(page_title=cfg.title, layout="wide")
|
67 |
|
68 |
# left side content
|
@@ -152,7 +152,7 @@ def launch_bot():
|
|
152 |
if __name__ == "__main__":
|
153 |
st.set_page_config(page_title="Sticky toolbar test", layout="wide")
|
154 |
nest_asyncio.apply()
|
155 |
-
|
156 |
|
157 |
for i in range(100):
|
158 |
st.write(f"This is scrollable content line {i}")
|
|
|
41 |
return False
|
42 |
|
43 |
if 'cfg' not in st.session_state:
|
44 |
+
corpus_keys = str(os.environ["first, last"]).split(',')
|
45 |
cfg = OmegaConf.create({
|
46 |
+
# 'corpus_keys': corpus_keys,
|
47 |
+
# 'api_key': str(os.environ['api_key']),
|
48 |
'title': os.environ['title'],
|
49 |
+
# 'source_data_desc': os.environ['source_data_desc'],
|
50 |
+
# 'streaming': isTrue(os.environ.get('streaming', False)),
|
51 |
+
# 'prompt_name': os.environ.get('prompt_name', None),
|
52 |
+
# 'examples': os.environ.get('examples', None),
|
53 |
+
# 'language': 'English'
|
54 |
})
|
55 |
+
#st.session_state.cfg = cfg
|
56 |
+
#st.session_state.ex_prompt = None
|
57 |
+
#st.session_state.first_turn = True
|
58 |
+
#st.session_state.language = cfg.language
|
59 |
+
#example_messages = [example.strip() for example in cfg.examples.split(",")]
|
60 |
+
#st.session_state.example_messages = [em for em in example_messages if len(em)>0][:max_examples]
|
61 |
|
62 |
+
#st.session_state.vq = VectaraQuery(cfg.api_key, cfg.corpus_keys, cfg.prompt_name)
|
63 |
|
64 |
cfg = st.session_state.cfg
|
65 |
+
#vq = st.session_state.vq
|
66 |
st.set_page_config(page_title=cfg.title, layout="wide")
|
67 |
|
68 |
# left side content
|
|
|
152 |
if __name__ == "__main__":
|
153 |
st.set_page_config(page_title="Sticky toolbar test", layout="wide")
|
154 |
nest_asyncio.apply()
|
155 |
+
asyncio.run(launch_bot())
|
156 |
|
157 |
for i in range(100):
|
158 |
st.write(f"This is scrollable content line {i}")
|