Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,11 +11,23 @@ from huggingface_hub import Repository, upload_file
|
|
| 11 |
url = "https://oxyjon.com/blog/"
|
| 12 |
loader = WebBaseLoader(url)
|
| 13 |
document = loader.load()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
print(
|
| 19 |
-
print(texts[3])
|
| 20 |
-
print(texts[17])
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
url = "https://oxyjon.com/blog/"
|
| 12 |
loader = WebBaseLoader(url)
|
| 13 |
document = loader.load()
|
| 14 |
+
|
| 15 |
+
def create_vector_db():
|
| 16 |
+
|
| 17 |
+
# split the document into chunks
|
| 18 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=256, chunk_overlap=50)
|
| 19 |
+
texts = text_splitter.split_documents(document)
|
| 20 |
+
print(texts[1])
|
| 21 |
+
print(texts[3])
|
| 22 |
+
print(texts[17])
|
| 23 |
+
|
| 24 |
+
df = pd.DataFrame(texts)
|
| 25 |
|
| 26 |
+
column_headers = list(df.columns.values)
|
| 27 |
+
print(column_headers)
|
| 28 |
+
pd.options.display.max_colwidth = 300
|
| 29 |
+
print(df.iloc[[3]])
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
if __name__ == "__main__":
|
| 32 |
+
print("check31")
|
| 33 |
+
create_vector_db()
|