Update app.py
Browse files179 unmodified lines18018118218318418518644 unmodified lines23123223323423523623724 unmodified lines262263264265266267268269270271272273274275179 unmodified linesif search_engine == "Google":search_results = google_search(message)else:search_results = duckduckgo_search(message)# Check if we have a FAISS databaseif os.path.exists("faiss_database"):44 unmodified linessources_section = "\n\nSources:\n" + "\n".join(f"- {source}" for source in sources)response += sources_sectionreturn response# Gradio interfacedemo = gr.Blocks()24 unmodified linesrespond,inputs=[message_input,chatbot,temperature,top_p,repetition_penalty,max_tokens,search_engine],outputs=chatbot)clear_button = gr.Button("Clear Cache")179 unmodified lines18018118218318418518644 unmodified lines23123223323423523623723823924 unmodified lines264265266267268269270271272273274275276277179 unmodified linesif search_engine == "Google":search_results = google_search(message)else:search_results = duckduckgo_search(message, max_results=5)# Check if we have a FAISS databaseif os.path.exists("faiss_database"):44 unmodified linessources_section = "\n\nSources:\n" + "\n".join(f"- {source}" for source in sources)response += sources_section# Update history and returnhistory.append((message, response))return history# Gradio interfacedemo = gr.Blocks()24 unmodified linesrespond,inputs=[message_input,gr.State([]), # Initialize empty historytemperature,top_p,repetition_penalty,max_tokens,search_engine],outputs=[chatbot])clear_button = gr.Button("Clear Cache")
app.py+6-4