Spaces:
Build error
Build error
Update app.py
Browse files97 unmodified lines989910010110210330 unmodified lines13413513613797 unmodified linestry:bot_response = demo(relevant_text) # Pass the string to the modelexcept Exception as e:logging.error(f"DeepSeek model error: {e}")bot_response = "I'm having trouble generating a response right now."30 unmodified lines# Launch the Gradio appif __name__ == "__main__":app.launch(debug=True)97 unmodified lines989910010110210310410510610710810911011111211330 unmodified lines14414514614797 unmodified linestry:bot_response = demo(relevant_text) # Pass the string to the modellogging.info(f"Model Output: {bot_response}") # Log the output for debugging# Handle different output formatsif isinstance(bot_response, dict) and "response" in bot_response:bot_response = bot_response["response"]elif isinstance(bot_response, list):bot_response = " ".join(bot_response) # Concatenate list into a stringelif not isinstance(bot_response, str):bot_response = str(bot_response) # Convert to string if not alreadyexcept Exception as e:logging.error(f"DeepSeek model error: {e}")bot_response = "I'm having trouble generating a response right now."30 unmodified lines# Launch the Gradio appif __name__ == "__main__":app.launch(debug=True)
app.py+11-1