Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import os
|
2 |
from dotenv import load_dotenv
|
3 |
|
4 |
-
# Load
|
5 |
-
|
|
|
6 |
|
7 |
-
from Rag_conversation import rag_chain # Now import the
|
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:
|