Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,18 +15,17 @@ def launch_bot():
|
|
15 |
|
16 |
if 'cfg' not in st.session_state:
|
17 |
corpus_ids = str(os.environ['corpus_ids']).split(',')
|
18 |
-
questions = list(eval(os.environ['examples']))
|
19 |
cfg = OmegaConf.create({
|
20 |
'customer_id': str(os.environ['customer_id']),
|
21 |
'corpus_ids': corpus_ids,
|
22 |
'api_key': str(os.environ['api_key']),
|
23 |
'title': os.environ['title'],
|
24 |
'description': os.environ['description'],
|
25 |
-
'
|
26 |
-
'
|
27 |
})
|
28 |
st.session_state.cfg = cfg
|
29 |
-
st.session_state.vq = VectaraQuery(cfg.api_key, cfg.customer_id, cfg.corpus_ids)
|
30 |
|
31 |
cfg = st.session_state.cfg
|
32 |
vq = st.session_state.vq
|
@@ -36,7 +35,7 @@ def launch_bot():
|
|
36 |
with st.sidebar:
|
37 |
image = Image.open('Vectara-logo.png')
|
38 |
st.markdown(f"## Welcome to {cfg.title}\n\n"
|
39 |
-
f"
|
40 |
|
41 |
st.markdown("---")
|
42 |
st.markdown(
|
@@ -76,3 +75,4 @@ def launch_bot():
|
|
76 |
|
77 |
if __name__ == "__main__":
|
78 |
launch_bot()
|
|
|
|
15 |
|
16 |
if 'cfg' not in st.session_state:
|
17 |
corpus_ids = str(os.environ['corpus_ids']).split(',')
|
|
|
18 |
cfg = OmegaConf.create({
|
19 |
'customer_id': str(os.environ['customer_id']),
|
20 |
'corpus_ids': corpus_ids,
|
21 |
'api_key': str(os.environ['api_key']),
|
22 |
'title': os.environ['title'],
|
23 |
'description': os.environ['description'],
|
24 |
+
'source_data_desc': os.environ['source_data_desc'],
|
25 |
+
'prompt_name': os.environ.get('prompt_name', None)
|
26 |
})
|
27 |
st.session_state.cfg = cfg
|
28 |
+
st.session_state.vq = VectaraQuery(cfg.api_key, cfg.customer_id, cfg.corpus_ids, cfg.prompt_name)
|
29 |
|
30 |
cfg = st.session_state.cfg
|
31 |
vq = st.session_state.vq
|
|
|
35 |
with st.sidebar:
|
36 |
image = Image.open('Vectara-logo.png')
|
37 |
st.markdown(f"## Welcome to {cfg.title}\n\n"
|
38 |
+
f"This demo uses Retrieval Augmented Generation to ask questions about {cfg.source_data_desc}\n\n")
|
39 |
|
40 |
st.markdown("---")
|
41 |
st.markdown(
|
|
|
75 |
|
76 |
if __name__ == "__main__":
|
77 |
launch_bot()
|
78 |
+
|