ashfaq93 commited on
Commit
690e2f0
·
verified ·
1 Parent(s): 71e83ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import os
2
  from dotenv import load_dotenv
3
 
4
- # Load .env from the root directory
5
- load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), ".env"))
 
6
 
7
- from Rag_conversation import rag_chain # Now import the chatbot pipeline
8
  import gradio as gr
9
  from langchain_core.messages import HumanMessage, SystemMessage
10
 
11
- # Function to process user messages
12
  def chatbot(user_message, history):
13
  chat_history = []
14
  for h in history:
 
1
  import os
2
  from dotenv import load_dotenv
3
 
4
+ # Load environment variables from root .env file
5
+ dotenv_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), ".env")
6
+ load_dotenv(dotenv_path=dotenv_path)
7
 
8
+ from Rag_conversation import rag_chain # Now import the RAG pipeline
9
  import gradio as gr
10
  from langchain_core.messages import HumanMessage, SystemMessage
11
 
 
12
  def chatbot(user_message, history):
13
  chat_history = []
14
  for h in history: