Spaces:
Sleeping
Sleeping
Commit
·
9e4c9f3
1
Parent(s):
a7ccdf0
updated pom file
Browse files- app.py +20 -4
- packages.txt +1 -0
- requirements.txt +5 -0
app.py
CHANGED
|
@@ -1,6 +1,24 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from tempfile import NamedTemporaryFile
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
radioButtonList = ["E-commerce CSV (https://www.kaggle.com/datasets/mervemenekse/ecommerce-dataset)",
|
| 6 |
"Upload my own CSV",
|
|
@@ -52,8 +70,6 @@ elif genre==radioButtonList[4]:
|
|
| 52 |
chatTextStr = st.text_input(f'Ask me anything about this {pdfCSVURLText}', '', placeholder="Type your question here (e.g. what was the most sold item?)", disabled=not enableChatBox)
|
| 53 |
chatWithPDFButton = "CLICK HERE TO START CHATTING"
|
| 54 |
if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr): # Button Cliked
|
| 55 |
-
|
| 56 |
-
st.write('Invalid ULR. Please enter a valid URL.')
|
| 57 |
-
print("Successfully processed files")
|
| 58 |
# else:
|
| 59 |
# pass
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from tempfile import NamedTemporaryFile
|
| 3 |
+
|
| 4 |
+
import pprint
|
| 5 |
+
import google.generativeai as palm
|
| 6 |
+
import os
|
| 7 |
+
from dotenv import load_dotenv, find_dotenv
|
| 8 |
+
from langchain.embeddings import GooglePalmEmbeddings
|
| 9 |
+
from langchain.llms import GooglePalm
|
| 10 |
+
|
| 11 |
+
from langchain.document_loaders import UnstructuredURLLoader #load urls into docoument-loader
|
| 12 |
+
from langchain.chains.question_answering import load_qa_chain
|
| 13 |
+
from langchain.indexes import VectorstoreIndexCreator #vectorize db index with chromadb
|
| 14 |
+
from langchain.text_splitter import CharacterTextSplitter #text splitter
|
| 15 |
+
from langchain.chains import RetrievalQA
|
| 16 |
+
from langchain.document_loaders import UnstructuredPDFLoader #load pdf
|
| 17 |
+
from langchain.agents import create_pandas_dataframe_agent
|
| 18 |
+
|
| 19 |
+
import pandas as pd
|
| 20 |
+
import numpy as np
|
| 21 |
+
import pprint
|
| 22 |
|
| 23 |
radioButtonList = ["E-commerce CSV (https://www.kaggle.com/datasets/mervemenekse/ecommerce-dataset)",
|
| 24 |
"Upload my own CSV",
|
|
|
|
| 70 |
chatTextStr = st.text_input(f'Ask me anything about this {pdfCSVURLText}', '', placeholder="Type your question here (e.g. what was the most sold item?)", disabled=not enableChatBox)
|
| 71 |
chatWithPDFButton = "CLICK HERE TO START CHATTING"
|
| 72 |
if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr): # Button Cliked
|
| 73 |
+
st.write('Invalid ULR. Please enter a valid URL.')
|
|
|
|
|
|
|
| 74 |
# else:
|
| 75 |
# pass
|
packages.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
libmagic-dev
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
google-generativeai
|
| 2 |
+
langchain
|
| 3 |
+
unstructured
|
| 4 |
+
chromadb
|
| 5 |
+
pdfminer.six
|