nurindahpratiwi
commited on
Commit
β’
4d6285b
1
Parent(s):
e7551ac
add banner
Browse files
app.py
CHANGED
@@ -9,13 +9,14 @@ from langchain.chains import ConversationalRetrievalChain
|
|
9 |
from htmltemp import css, bot_template, user_template
|
10 |
from langchain.llms import HuggingFaceHub
|
11 |
|
|
|
12 |
|
13 |
def main():
|
14 |
load_dotenv()
|
15 |
st.set_page_config(page_title="PDF Chatbot", page_icon="π")
|
16 |
custom_html = """
|
17 |
<div class="banner">
|
18 |
-
<img src="https://
|
19 |
</div>
|
20 |
<style>
|
21 |
.banner {
|
@@ -93,7 +94,7 @@ def get_conversation_chain(vectorstore):
|
|
93 |
llm = HuggingFaceHub(
|
94 |
repo_id="google/flan-t5-large",
|
95 |
model_kwargs={"temperature": 0.5, "max_length": 1024},
|
96 |
-
|
97 |
)
|
98 |
|
99 |
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
|
|
|
9 |
from htmltemp import css, bot_template, user_template
|
10 |
from langchain.llms import HuggingFaceHub
|
11 |
|
12 |
+
api_key = st.secrets['api_key']
|
13 |
|
14 |
def main():
|
15 |
load_dotenv()
|
16 |
st.set_page_config(page_title="PDF Chatbot", page_icon="π")
|
17 |
custom_html = """
|
18 |
<div class="banner">
|
19 |
+
<img src="https://huggingface.co/spaces/wiwaaw/summary/resolve/main/banner.png" alt="Banner Image">
|
20 |
</div>
|
21 |
<style>
|
22 |
.banner {
|
|
|
94 |
llm = HuggingFaceHub(
|
95 |
repo_id="google/flan-t5-large",
|
96 |
model_kwargs={"temperature": 0.5, "max_length": 1024},
|
97 |
+
huggingfacehub_api_token=api_key
|
98 |
)
|
99 |
|
100 |
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
|