Spaces:
Runtime error
Runtime error
Commit
·
5b84c9e
1
Parent(s):
17cc7b0
Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,10 @@ import os
|
|
9 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = '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'
|
10 |
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl")
|
11 |
embeddings = HuggingFaceEmbeddings()
|
12 |
-
|
13 |
-
|
14 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
15 |
-
texts = text_splitter.
|
16 |
db = Chroma.from_documents(texts, embeddings)
|
17 |
retriever = db.as_retriever()
|
18 |
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
|
|
|
9 |
os.environ['HUGGINGFACEHUB_API_TOKEN'] = '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'
|
10 |
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl")
|
11 |
embeddings = HuggingFaceEmbeddings()
|
12 |
+
loader = TextLoader('us.txt')
|
13 |
+
documents = loader.load()
|
14 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
15 |
+
texts = text_splitter.split_documents(documents)
|
16 |
db = Chroma.from_documents(texts, embeddings)
|
17 |
retriever = db.as_retriever()
|
18 |
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
|