Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
import langchain
|
| 6 |
import streamlit as st
|
| 7 |
import pickle as pkl
|
|
@@ -30,6 +28,7 @@ except Exception as e:
|
|
| 30 |
st.error(f"Failed to load embedding model: {str(e)}")
|
| 31 |
st.stop()
|
| 32 |
|
|
|
|
| 33 |
st.title("URL ANALYSER🔗")
|
| 34 |
st.sidebar.title("Give your URls🔗?")
|
| 35 |
mp=st.empty()
|
|
@@ -49,6 +48,7 @@ if purs:
|
|
| 49 |
mp.text("Loading..txt..splitter....☑️☑️☑️")
|
| 50 |
tot=RecursiveCharacterTextSplitter.from_tiktoken_encoder(encoding_name="cl100k_base",chunk_size=512,chunk_overlap=16)
|
| 51 |
doccs=tot.split_documents(docs)
|
|
|
|
| 52 |
mp.text("Loading..VB...☑️☑️☑️")
|
| 53 |
vv=Chroma.from_documents(doccs,m1)
|
| 54 |
r2=vv.as_retriever(search_type="similarity",search_kwargs={"k":4})
|
|
|
|
| 1 |
import os
|
| 2 |
+
import joblib
|
|
|
|
|
|
|
| 3 |
import langchain
|
| 4 |
import streamlit as st
|
| 5 |
import pickle as pkl
|
|
|
|
| 28 |
st.error(f"Failed to load embedding model: {str(e)}")
|
| 29 |
st.stop()
|
| 30 |
|
| 31 |
+
m2=joblib.load("m1.joblib")
|
| 32 |
st.title("URL ANALYSER🔗")
|
| 33 |
st.sidebar.title("Give your URls🔗?")
|
| 34 |
mp=st.empty()
|
|
|
|
| 48 |
mp.text("Loading..txt..splitter....☑️☑️☑️")
|
| 49 |
tot=RecursiveCharacterTextSplitter.from_tiktoken_encoder(encoding_name="cl100k_base",chunk_size=512,chunk_overlap=16)
|
| 50 |
doccs=tot.split_documents(docs)
|
| 51 |
+
st.write(len(doccs))
|
| 52 |
mp.text("Loading..VB...☑️☑️☑️")
|
| 53 |
vv=Chroma.from_documents(doccs,m1)
|
| 54 |
r2=vv.as_retriever(search_type="similarity",search_kwargs={"k":4})
|