Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ llm = HuggingFaceEndpoint(repo_id="mistralai/Mistral-7B-Instruct-v0.2", Temperat
|
|
24 |
#llm = VertexAI(model_name="text-bison@001",max_output_tokens=256,temperature=0.1,top_p=0.8,top_k=40,verbose=True,)
|
25 |
|
26 |
#embeddings = VertexAIEmbeddings()
|
27 |
-
embeddings = model.encode(sentences)
|
28 |
|
29 |
#The below code scrapes all the text data from the webpage link provided by the user and saves it in a text file.
|
30 |
def get_text(url):
|
@@ -51,7 +51,7 @@ def create_langchain_index(input_text):
|
|
51 |
loader = TextLoader("text\\temp.txt", encoding='utf-8')
|
52 |
# data = loader.load()
|
53 |
|
54 |
-
index = VectorstoreIndexCreator(vectorstore_cls=DocArrayInMemorySearch,embedding=
|
55 |
return index
|
56 |
|
57 |
# @st.cache_resource
|
|
|
24 |
#llm = VertexAI(model_name="text-bison@001",max_output_tokens=256,temperature=0.1,top_p=0.8,top_k=40,verbose=True,)
|
25 |
|
26 |
#embeddings = VertexAIEmbeddings()
|
27 |
+
#embeddings = model.encode(sentences)
|
28 |
|
29 |
#The below code scrapes all the text data from the webpage link provided by the user and saves it in a text file.
|
30 |
def get_text(url):
|
|
|
51 |
loader = TextLoader("text\\temp.txt", encoding='utf-8')
|
52 |
# data = loader.load()
|
53 |
|
54 |
+
index = VectorstoreIndexCreator(vectorstore_cls=DocArrayInMemorySearch,embedding=model.encode(input_text)).from_loaders([loader])
|
55 |
return index
|
56 |
|
57 |
# @st.cache_resource
|