Skip to content

Commit

Permalink
Fix processing of optional embeddings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmitsch committed Oct 13, 2023
1 parent bb54f3d commit 6c2277a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spacy_llm/tasks/entity_linker/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ def __call__(self, vocab: Vocab) -> Tuple[InMemoryLookupKB, DescFormat]:
qids = list(entities.keys())
kb = InMemoryLookupKB(
vocab=vocab,
entity_vector_length=len(kb_data["entities"][qids[0]]["embedding"]),
entity_vector_length=len(
kb_data["entities"][qids[0]].get("embedding", [0])
),
)

# Set entities (with dummy values for frequencies).
Expand Down

0 comments on commit 6c2277a

Please sign in to comment.