Spaces:
Runtime error
Runtime error
Update app.py
Browse files89 unmodified lines9091929394959697989910010110210310489 unmodified linesfull_response = ""for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature, use_embeddings=use_embeddings, system_prompt=system_prompt):full_response += main_contentyield history + [(message, full_response)]if sources:full_response += f"\n\nSources:\n{sources}"yield history + [(message, full_response)]except Exception as e:logging.error(f"Error with {model}: {str(e)}")error_message = f"An error occurred with the {model} model: {str(e)}. Please try again or select a different model."yield history + [(message, error_message)]def create_web_search_vectors(search_results):embed = get_embeddings()89 unmodified lines9091929394959697989910010110210310410510610789 unmodified linesfull_response = ""for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature, use_embeddings=use_embeddings, system_prompt=system_prompt):full_response += main_contentnew_history = history + [(message, full_response)]yield new_historyif sources:full_response += f"\n\nSources:\n{sources}"new_history = history + [(message, full_response)]yield new_historyexcept Exception as e:logging.error(f"Error with {model}: {str(e)}")error_message = f"An error occurred with the {model} model: {str(e)}. Please try again or select a different model."new_history = history + [(message, error_message)]yield new_historydef create_web_search_vectors(search_results):embed = get_embeddings()
app.py+6-3