timep12345 commited on
Commit
c8ea47a
·
1 Parent(s): 103319b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import json
5
  from langchain.document_loaders import DataFrameLoader
6
  from langchain.text_splitter import CharacterTextSplitter
7
  from langchain.llms import HuggingFaceHub
8
- from langchain.embeddings import HuggingFaceEmbeddings
9
  from langchain.vectorstores import Chroma
10
  from langchain.chains import RetrievalQA
11
 
@@ -38,10 +38,7 @@ def url_changes(url, pages_to_visit, urls_to_scrape, repo_id):
38
  documents = loader.load()
39
  text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
40
  texts = text_splitter.split_documents(documents)
41
- emb_model = "snunlp/KR-SBERT-V40K-klueNLI-augSTS"
42
- embeddings = HuggingFaceEmbeddings(
43
- model_name=emb_model
44
- )
45
  db = Chroma.from_documents(texts, embeddings)
46
  retriever = db.as_retriever()
47
  llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={"temperature":0.1, "max_new_tokens":250})
 
5
  from langchain.document_loaders import DataFrameLoader
6
  from langchain.text_splitter import CharacterTextSplitter
7
  from langchain.llms import HuggingFaceHub
8
+ from langchain.embeddings import HuggingFaceHubEmbeddings
9
  from langchain.vectorstores import Chroma
10
  from langchain.chains import RetrievalQA
11
 
 
38
  documents = loader.load()
39
  text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
40
  texts = text_splitter.split_documents(documents)
41
+ embeddings = HuggingFaceHubEmbeddings()
 
 
 
42
  db = Chroma.from_documents(texts, embeddings)
43
  retriever = db.as_retriever()
44
  llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={"temperature":0.1, "max_new_tokens":250})