Update app.py
Browse files
app.py
CHANGED
|
@@ -65,8 +65,8 @@ txts_dir = docs_dir + 'txt/'
|
|
| 65 |
# with open(f'{docs_dir}intents/{row["intent"]}_{intent_index}.txt', 'w') as f:
|
| 66 |
# f.write(row['response'])
|
| 67 |
# previous_row = row
|
| 68 |
-
loader = DirectoryLoader(txts_dir)
|
| 69 |
-
txt_documents = loader.load()
|
| 70 |
loader = UnstructuredURLLoader(urls=['https://sherlock-ph.readthedocs.io/en/latest/',
|
| 71 |
'https://tkmatrix.readthedocs.io/en/latest/',
|
| 72 |
'https://dearwatson.readthedocs.io/en/latest/',
|
|
@@ -174,14 +174,13 @@ def chat(message, history):
|
|
| 174 |
# print(f"Sources: {response['source_documents']}")
|
| 175 |
|
| 176 |
gr.ChatInterface(chat, chatbot=gr.Chatbot(),
|
| 177 |
-
textbox=gr.Textbox(placeholder="
|
| 178 |
-
title="
|
| 179 |
-
description="
|
| 180 |
theme="soft",
|
| 181 |
-
examples=["
|
| 182 |
-
"How should I cite SHERLOCK?", "How should I cite MATRIX?"],
|
| 183 |
cache_examples=False,
|
| 184 |
retry_btn=None,
|
| 185 |
-
undo_btn="
|
| 186 |
-
clear_btn="
|
| 187 |
|
|
|
|
| 65 |
# with open(f'{docs_dir}intents/{row["intent"]}_{intent_index}.txt', 'w') as f:
|
| 66 |
# f.write(row['response'])
|
| 67 |
# previous_row = row
|
| 68 |
+
#loader = DirectoryLoader(txts_dir)
|
| 69 |
+
#txt_documents = loader.load()
|
| 70 |
loader = UnstructuredURLLoader(urls=['https://sherlock-ph.readthedocs.io/en/latest/',
|
| 71 |
'https://tkmatrix.readthedocs.io/en/latest/',
|
| 72 |
'https://dearwatson.readthedocs.io/en/latest/',
|
|
|
|
| 174 |
# print(f"Sources: {response['source_documents']}")
|
| 175 |
|
| 176 |
gr.ChatInterface(chat, chatbot=gr.Chatbot(),
|
| 177 |
+
textbox=gr.Textbox(placeholder="Pregúntame lo que quieras sobre INGGRIM!", container=False, scale=7),
|
| 178 |
+
title="Todo sobre la novela río: INGGRIM",
|
| 179 |
+
description="Pregúntame lo que quieras sobre INGGRIM!",
|
| 180 |
theme="soft",
|
| 181 |
+
examples=["¿Quién es Stewart David?", "¿Cuáles son las facciones presentes en INGGRIM?", "¿Cómo es el mapa del mundo de INGGRIM?"],
|
|
|
|
| 182 |
cache_examples=False,
|
| 183 |
retry_btn=None,
|
| 184 |
+
undo_btn="Borrar anterior",
|
| 185 |
+
clear_btn="Borrar").queue().launch()
|
| 186 |
|