Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,12 +8,12 @@ import torch
|
|
| 8 |
|
| 9 |
#STEP 2 FROM SEMANTIC SEARCH
|
| 10 |
# Open the water_cycle.txt file in read mode with UTF-8 encoding
|
| 11 |
-
with open("
|
| 12 |
# Read the entire contents of the file and store it in a variable
|
| 13 |
-
|
| 14 |
|
| 15 |
# Print the text below
|
| 16 |
-
print(
|
| 17 |
|
| 18 |
#STEP 3 FROM SEMANTIC SEARCH
|
| 19 |
def preprocess_text(text):
|
|
@@ -42,7 +42,7 @@ def preprocess_text(text):
|
|
| 42 |
return cleaned_chunks
|
| 43 |
|
| 44 |
# Call the preprocess_text function and store the result in a cleaned_chunks variable
|
| 45 |
-
cleaned_chunks = preprocess_text(
|
| 46 |
|
| 47 |
#STEP 4 FROM SEMANTIC SEARCH
|
| 48 |
# Load the pre-trained embedding model that converts text to vectors
|
|
|
|
| 8 |
|
| 9 |
#STEP 2 FROM SEMANTIC SEARCH
|
| 10 |
# Open the water_cycle.txt file in read mode with UTF-8 encoding
|
| 11 |
+
with open("quentins_knowledge.txt", "r", encoding="utf-8") as file:
|
| 12 |
# Read the entire contents of the file and store it in a variable
|
| 13 |
+
quentins_knowledge = file.read()
|
| 14 |
|
| 15 |
# Print the text below
|
| 16 |
+
print(quentins_knowledge)
|
| 17 |
|
| 18 |
#STEP 3 FROM SEMANTIC SEARCH
|
| 19 |
def preprocess_text(text):
|
|
|
|
| 42 |
return cleaned_chunks
|
| 43 |
|
| 44 |
# Call the preprocess_text function and store the result in a cleaned_chunks variable
|
| 45 |
+
cleaned_chunks = preprocess_text(quentins_knowledge)
|
| 46 |
|
| 47 |
#STEP 4 FROM SEMANTIC SEARCH
|
| 48 |
# Load the pre-trained embedding model that converts text to vectors
|