Spaces:
Runtime error
Runtime error
Commit
·
8e6aeef
1
Parent(s):
7824737
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,10 +10,8 @@ os.environ['HUGGINGFACEHUB_API_TOKEN'] = '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'
|
|
| 10 |
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl")
|
| 11 |
B=open('us.txt')
|
| 12 |
Biden=B.read()
|
| 13 |
-
loader = TextLoader(Biden)
|
| 14 |
-
documents = loader.load()
|
| 15 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
| 16 |
-
texts = text_splitter.
|
| 17 |
db = Chroma.from_documents(texts, embeddings)
|
| 18 |
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
|
| 19 |
def answer(query):
|
|
|
|
| 10 |
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl")
|
| 11 |
B=open('us.txt')
|
| 12 |
Biden=B.read()
|
|
|
|
|
|
|
| 13 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
| 14 |
+
texts = text_splitter.split_text(Biden)
|
| 15 |
db = Chroma.from_documents(texts, embeddings)
|
| 16 |
qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
|
| 17 |
def answer(query):
|