Fixed input text loading bug (forgot to filter out empty lines)
Browse files
app.py
CHANGED
|
@@ -9,8 +9,14 @@ from sentence_transformers import util
|
|
| 9 |
|
| 10 |
@st.cache(hash_funcs={list: lambda _: None})
|
| 11 |
def load_raw_sentences(filename):
|
|
|
|
| 12 |
with open(filename) as f:
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
@st.cache(hash_funcs={torch.Tensor: lambda _: None})
|
| 16 |
def load_embeddings(filename):
|
|
|
|
| 9 |
|
| 10 |
@st.cache(hash_funcs={list: lambda _: None})
|
| 11 |
def load_raw_sentences(filename):
|
| 12 |
+
fitered_data = []
|
| 13 |
with open(filename) as f:
|
| 14 |
+
raw_data = f.readlines()
|
| 15 |
+
for line in raw_data:
|
| 16 |
+
if len(line)>1:
|
| 17 |
+
filtered_data.append(line)
|
| 18 |
+
return filtered_data
|
| 19 |
+
|
| 20 |
|
| 21 |
@st.cache(hash_funcs={torch.Tensor: lambda _: None})
|
| 22 |
def load_embeddings(filename):
|