Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,10 +6,10 @@ from sentence_transformers import SentenceTransformer
|
|
| 6 |
import torch
|
| 7 |
|
| 8 |
# SEMANTIC SEARCH STEP 2 --> EDIT WITH YOUR OWN KNOWLEDGE BASE WHEN READY
|
| 9 |
-
with open("
|
| 10 |
# Read the entire contents of the file and store it in a variable
|
| 11 |
-
|
| 12 |
-
print(
|
| 13 |
|
| 14 |
# SEMANTIC SEARCH STEP 3
|
| 15 |
def preprocess_text(text):
|
|
@@ -34,7 +34,7 @@ def preprocess_text(text):
|
|
| 34 |
return cleaned_chunks
|
| 35 |
|
| 36 |
# Call the preprocess_text function and store the result in a cleaned_chunks variable
|
| 37 |
-
cleaned_chunks = preprocess_text(
|
| 38 |
|
| 39 |
# SEMANTIC SEARCH STEP 4
|
| 40 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
|
|
|
| 6 |
import torch
|
| 7 |
|
| 8 |
# SEMANTIC SEARCH STEP 2 --> EDIT WITH YOUR OWN KNOWLEDGE BASE WHEN READY
|
| 9 |
+
with open("skin_cancer_harvard.txt", "r", encoding="utf-8") as file:
|
| 10 |
# Read the entire contents of the file and store it in a variable
|
| 11 |
+
skin_cancer_harvard_text = file.read()
|
| 12 |
+
print(skin_cancer_harvard_text)
|
| 13 |
|
| 14 |
# SEMANTIC SEARCH STEP 3
|
| 15 |
def preprocess_text(text):
|
|
|
|
| 34 |
return cleaned_chunks
|
| 35 |
|
| 36 |
# Call the preprocess_text function and store the result in a cleaned_chunks variable
|
| 37 |
+
cleaned_chunks = preprocess_text(skin_cancer_harvard_text) # Complete this line; edit with my knowledgebase when ready
|
| 38 |
|
| 39 |
# SEMANTIC SEARCH STEP 4
|
| 40 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|