Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ def get_vector_store(chunks):
|
|
| 46 |
|
| 47 |
def get_conversational_chain():
|
| 48 |
prompt_template = """
|
| 49 |
-
Answer the question as detailed as possible from the provided context, make sure to provide all the details, if the answer is not in
|
| 50 |
provided context just say, "answer is not available in the context", don't provide the wrong answer\n\n
|
| 51 |
Context:\n {context}?\n
|
| 52 |
Question: \n{question}\n
|
|
@@ -54,7 +54,7 @@ def get_conversational_chain():
|
|
| 54 |
Answer:
|
| 55 |
"""
|
| 56 |
|
| 57 |
-
model = ChatGoogleGenerativeAI(model="gemini-
|
| 58 |
client=genai,
|
| 59 |
temperature=0.3,
|
| 60 |
)
|
|
@@ -90,7 +90,10 @@ def main():
|
|
| 90 |
page_title="Gemini PDF Chatbot",
|
| 91 |
page_icon="🤖"
|
| 92 |
)
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
| 94 |
# Sidebar for uploading PDF files
|
| 95 |
with st.sidebar:
|
| 96 |
st.title("Menu:")
|
|
@@ -104,8 +107,8 @@ def main():
|
|
| 104 |
st.success("Done")
|
| 105 |
|
| 106 |
# Main content area for displaying chat messages
|
| 107 |
-
st.title("Chat with
|
| 108 |
-
st.write("Welcome to the
|
| 109 |
st.sidebar.button('Clear Chat History', on_click=clear_chat_history)
|
| 110 |
|
| 111 |
# Chat input
|
|
|
|
| 46 |
|
| 47 |
def get_conversational_chain():
|
| 48 |
prompt_template = """
|
| 49 |
+
You an economist.Answer the question as detailed as possible from the provided context, make sure to provide all the details, if the answer is not in
|
| 50 |
provided context just say, "answer is not available in the context", don't provide the wrong answer\n\n
|
| 51 |
Context:\n {context}?\n
|
| 52 |
Question: \n{question}\n
|
|
|
|
| 54 |
Answer:
|
| 55 |
"""
|
| 56 |
|
| 57 |
+
model = ChatGoogleGenerativeAI(model="gemini-1.5-flash",
|
| 58 |
client=genai,
|
| 59 |
temperature=0.3,
|
| 60 |
)
|
|
|
|
| 90 |
page_title="Gemini PDF Chatbot",
|
| 91 |
page_icon="🤖"
|
| 92 |
)
|
| 93 |
+
raw_text = get_pdf_text("*.pdf")
|
| 94 |
+
text_chunks = get_text_chunks(raw_text)
|
| 95 |
+
get_vector_store(text_chunks)
|
| 96 |
+
|
| 97 |
# Sidebar for uploading PDF files
|
| 98 |
with st.sidebar:
|
| 99 |
st.title("Menu:")
|
|
|
|
| 107 |
st.success("Done")
|
| 108 |
|
| 109 |
# Main content area for displaying chat messages
|
| 110 |
+
st.title("Chat with the Budget 2024-2025 using Gemini🤖")
|
| 111 |
+
st.write("Welcome to the Budget 2024-2025 chatbot!")
|
| 112 |
st.sidebar.button('Clear Chat History', on_click=clear_chat_history)
|
| 113 |
|
| 114 |
# Chat input
|