Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ cfg = OmegaConf.create({
|
|
| 13 |
'corpus_keys': corpus_keys,
|
| 14 |
'api_key': str(os.environ['api_key']),
|
| 15 |
'title': os.environ['title'],
|
| 16 |
-
'description': os.environ['description'],
|
| 17 |
'source_data_desc': os.environ['source_data_desc'],
|
| 18 |
'streaming': isTrue(os.environ.get('streaming', False)),
|
| 19 |
'prompt_name': os.environ.get('prompt_name', None),
|
|
@@ -37,19 +36,7 @@ def respond(message, history):
|
|
| 37 |
response = vq.submit_query(message)
|
| 38 |
yield response
|
| 39 |
|
| 40 |
-
|
| 41 |
-
# cfg.description = f'''
|
| 42 |
-
# <table>
|
| 43 |
-
# <tr>
|
| 44 |
-
# <td style="width: 33%; vertical-align: top;"> <img src="https://github.com/david-oplatka/chatbot-streamlit/blob/main/Vectara-logo.png?raw=true"> </td>
|
| 45 |
-
# <td style="width: 34%; vertical-align: middle;"> <h1>{cfg.title}</h1> </td>
|
| 46 |
-
# <td style="width: 33%; vertical-align: bottom; text-align: left"> This demo uses Retrieval Augmented Generation from <a href="https://vectara.com/">Vectara</a><br>to ask questions about {cfg.source_data_desc}. </td>
|
| 47 |
-
# </tr>
|
| 48 |
-
# </table>
|
| 49 |
-
# <center> <h2>{cfg.description}</h2></center>
|
| 50 |
-
# '''
|
| 51 |
-
|
| 52 |
-
cfg.description = f'''
|
| 53 |
<table>
|
| 54 |
<tr>
|
| 55 |
<td style="width: 80%; text-align: left; vertical-align: middle;"> <h1>Vectara AI Assistant: {cfg.title}</h1> </td>
|
|
@@ -85,7 +72,7 @@ if cfg.examples:
|
|
| 85 |
else:
|
| 86 |
app_examples = None
|
| 87 |
|
| 88 |
-
demo = gr.ChatInterface(respond, description =
|
| 89 |
chatbot = gr.Chatbot(value = [[None, "How may I help you?"]]), examples = app_examples, cache_examples = False)
|
| 90 |
|
| 91 |
if __name__ == "__main__":
|
|
|
|
| 13 |
'corpus_keys': corpus_keys,
|
| 14 |
'api_key': str(os.environ['api_key']),
|
| 15 |
'title': os.environ['title'],
|
|
|
|
| 16 |
'source_data_desc': os.environ['source_data_desc'],
|
| 17 |
'streaming': isTrue(os.environ.get('streaming', False)),
|
| 18 |
'prompt_name': os.environ.get('prompt_name', None),
|
|
|
|
| 36 |
response = vq.submit_query(message)
|
| 37 |
yield response
|
| 38 |
|
| 39 |
+
heading_html = f'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
<table>
|
| 41 |
<tr>
|
| 42 |
<td style="width: 80%; text-align: left; vertical-align: middle;"> <h1>Vectara AI Assistant: {cfg.title}</h1> </td>
|
|
|
|
| 72 |
else:
|
| 73 |
app_examples = None
|
| 74 |
|
| 75 |
+
demo = gr.ChatInterface(respond, description = heading_html, css = css,
|
| 76 |
chatbot = gr.Chatbot(value = [[None, "How may I help you?"]]), examples = app_examples, cache_examples = False)
|
| 77 |
|
| 78 |
if __name__ == "__main__":
|