Spaces:
Sleeping
Sleeping
Stefan
commited on
Commit
·
e250f84
1
Parent(s):
7a37cd8
fix(spaces): remove types
Browse files- embedding.py +1 -1
- pg.py +1 -1
- processing.py +1 -1
embedding.py
CHANGED
@@ -13,7 +13,7 @@ def average_pool(last_hidden_states: Tensor, attention_mask: Tensor) -> Tensor:
|
|
13 |
return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]
|
14 |
|
15 |
|
16 |
-
def strings_to_vectors(strings
|
17 |
passage_batch = tokenizer(
|
18 |
strings,
|
19 |
max_length=EMBEDDING_CHAR_LIMIT,
|
|
|
13 |
return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]
|
14 |
|
15 |
|
16 |
+
def strings_to_vectors(strings):
|
17 |
passage_batch = tokenizer(
|
18 |
strings,
|
19 |
max_length=EMBEDDING_CHAR_LIMIT,
|
pg.py
CHANGED
@@ -10,7 +10,7 @@ pg = psycopg2.connect(
|
|
10 |
)
|
11 |
|
12 |
|
13 |
-
def get_chapters(ids
|
14 |
cur = pg.cursor()
|
15 |
cur.execute(
|
16 |
"""
|
|
|
10 |
)
|
11 |
|
12 |
|
13 |
+
def get_chapters(ids):
|
14 |
cur = pg.cursor()
|
15 |
cur.execute(
|
16 |
"""
|
processing.py
CHANGED
@@ -85,7 +85,7 @@ def truncate_to_sequences(text: str, max_char=EMBEDDING_CHAR_LIMIT) -> list[str]
|
|
85 |
return sequences
|
86 |
|
87 |
|
88 |
-
def md_to_passages(md: str)
|
89 |
initial_passages = clean_md(md)
|
90 |
passages = []
|
91 |
for p in initial_passages:
|
|
|
85 |
return sequences
|
86 |
|
87 |
|
88 |
+
def md_to_passages(md: str):
|
89 |
initial_passages = clean_md(md)
|
90 |
passages = []
|
91 |
for p in initial_passages:
|