MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _resize_vector

Function _resize_vector

skills/profile-updater/scripts/update_profile.py:384–393  ·  view source on GitHub ↗
(vector: List[float], target_dim: int)

Source from the content-addressed store, hash-verified

382
383
384def _resize_vector(vector: List[float], target_dim: int) -> List[float]:
385 if target_dim <= 0:
386 return []
387
388 values = [float(value) for value in (vector or [])]
389 if len(values) == target_dim:
390 return values
391 if len(values) > target_dim:
392 return values[:target_dim]
393 return values + [0.0] * (target_dim - len(values))
394
395
396def _normalize_vector(vector: List[float]) -> List[float]:

Callers 7

cosine_similarityFunction · 0.85
update_interest_vectorFunction · 0.85
_collect_embeddingsFunction · 0.85
_average_vectorFunction · 0.85
_explicit_prior_vectorFunction · 0.85
_blend_vectorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected