File size: 2,009 Bytes
84ddfaa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import streamlit as st
from streamlit_lottie import st_lottie


def faq():
    st.markdown(
        """
# FAQ
## How does Document Q&A Bot work?
When you upload a document (in Pdf, word, csv or txt format), it will be divided into smaller chunks 
and stored in a special type of database called a vector index 
that allows for semantic search and retrieval.

When you ask a question, our Q&A bot will first look through the document chunks and find the
most relevant ones using the vector index. Then, it will use open-source LLM model named Google Palm
and will provide the final answer.

## Is my data safe?
Yes, your data is safe. Our bot does not store your documents or
questions. All uploaded data is deleted after you close the browser tab.

## Why does it take so long to index my document?
Since, this is a sample QA bot project that uses open-source model
and doesn't have much resource capabilities like GPU, it may take time 
to index your document based on the size of the document.

## Are the answers 100% accurate?
No, the answers are not 100% accurate. 
But for most use cases, our QA bot is very accurate and can answer
most questions. Always check with the sources to make sure that the answers
are correct.
"""
    )


def sidebar():
    with st.sidebar:
        st.markdown("## Google Palm")
        
        st.success('API key already provided!', icon='✅')
        
        st.markdown(
            "## How to use QA bot\n"
            "1. Upload a pdf, docx, or a txt file📄\n"
            "2. Ask questions about the document💬\n"
        )

        # st.session_state["OPENAI_API_KEY"] = api_key_input

        st.markdown("---")
        st.markdown("# About")
        st.markdown(
            "🤖 QA bot allows you to ask questions about your "
            "documents and get accurate answers with citations. "
        )

        st.markdown("Created by [Krishna Kumar](https://www.linkedin.com/in/krishna-kumar-yadav-726831105/)")
        st.markdown("---")

        faq()