Spaces:
Sleeping
Sleeping
Download APPwithoutResetButton.py from Phoenix21/ARM_BASED_QA_CHATBOT: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/spaces/Phoenix21/ARM_BASED_QA_CHATBOT/resolve/main/APPwithoutResetButton.py
- Command line
-
hf download hf://spaces/Phoenix21/ARM_BASED_QA_CHATBOT/APPwithoutResetButton.py
-
curl -L -o APPwithoutResetButton.py https://huggingface.co/spaces/Phoenix21/ARM_BASED_QA_CHATBOT/resolve/main/APPwithoutResetButton.py
1.42 kB
| # # app.py | |
| # import gradio as gr | |
| # from pipeline import chatbot_response, generate_coherent_response, ChatHistory | |
| # # Create a new instance of chat history | |
| # chat_history = ChatHistory() | |
| # # Step 6: Define Gradio Interface for Chatbot | |
| # def gradio_chatbot(user_query): | |
| # # Step 7: Retrieve relevant data for the query | |
| # retrieved_data = chatbot_response(user_query) | |
| # # Step 8: Check and verify the query for health/wellness content | |
| # is_valid = True | |
| # if is_valid: | |
| # # Generate a coherent response using Groq's DeepSeek-R1 LLM | |
| # coherent_response = generate_coherent_response(user_query, retrieved_data, chat_history.get_history()) | |
| # else: | |
| # coherent_response = "The query does not seem to match health and wellness topics." | |
| # # Add the user message and assistant response to the chat history | |
| # chat_history.add_message("user", user_query) | |
| # chat_history.add_message("assistant", coherent_response) | |
| # # Return the response and the chat history | |
| # return coherent_response, chat_history.get_history() | |
| # # Create the Gradio interface | |
| # iface = gr.Interface(fn=gradio_chatbot, | |
| # inputs=gr.Textbox(label="Ask a question"), | |
| # outputs=[gr.Textbox(label="Chatbot Response"), gr.Textbox(label="Chat History")], | |
| # title="Wellness Chatbot") | |
| # # Launch the Gradio interface | |
| # iface.launch() | |