Update app.py
Browse files
app.py
CHANGED
|
@@ -107,6 +107,8 @@ def create_web_search_vectors(search_results):
|
|
| 107 |
return FAISS.from_documents(documents, embed)
|
| 108 |
|
| 109 |
def get_response_with_search(query, model, system_prompt=DEFAULT_SYSTEM_PROMPT, num_calls=3, temperature=0.2, use_embeddings=True):
|
|
|
|
|
|
|
| 110 |
search_results = duckduckgo_search(query)
|
| 111 |
|
| 112 |
if use_embeddings:
|
|
@@ -190,7 +192,7 @@ css = """
|
|
| 190 |
"""
|
| 191 |
|
| 192 |
demo = gr.ChatInterface(
|
| 193 |
-
respond,
|
| 194 |
additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=True, render=False),
|
| 195 |
additional_inputs=[
|
| 196 |
gr.Textbox(label="System Prompt", lines=5, value=DEFAULT_SYSTEM_PROMPT),
|
|
@@ -211,7 +213,7 @@ demo = gr.ChatInterface(
|
|
| 211 |
cache_examples=False,
|
| 212 |
analytics_enabled=False,
|
| 213 |
textbox=gr.Textbox(placeholder="Ask a question", container=False, scale=7),
|
| 214 |
-
chatbot
|
| 215 |
show_copy_button=True,
|
| 216 |
likeable=True,
|
| 217 |
layout="bubble",
|
|
|
|
| 107 |
return FAISS.from_documents(documents, embed)
|
| 108 |
|
| 109 |
def get_response_with_search(query, model, system_prompt=DEFAULT_SYSTEM_PROMPT, num_calls=3, temperature=0.2, use_embeddings=True):
|
| 110 |
+
logging.info(f"get_response_with_search - Query: {query}")
|
| 111 |
+
logging.info(f"get_response_with_search - System Prompt: {system_prompt}")
|
| 112 |
search_results = duckduckgo_search(query)
|
| 113 |
|
| 114 |
if use_embeddings:
|
|
|
|
| 192 |
"""
|
| 193 |
|
| 194 |
demo = gr.ChatInterface(
|
| 195 |
+
fn=lambda message, system_prompt, history, model, temperature, num_calls, use_embeddings: respond(message, system_prompt, history, model, temperature, num_calls, use_embeddings),
|
| 196 |
additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=True, render=False),
|
| 197 |
additional_inputs=[
|
| 198 |
gr.Textbox(label="System Prompt", lines=5, value=DEFAULT_SYSTEM_PROMPT),
|
|
|
|
| 213 |
cache_examples=False,
|
| 214 |
analytics_enabled=False,
|
| 215 |
textbox=gr.Textbox(placeholder="Ask a question", container=False, scale=7),
|
| 216 |
+
chatbot=gr.Chatbot(
|
| 217 |
show_copy_button=True,
|
| 218 |
likeable=True,
|
| 219 |
layout="bubble",
|