(vec)
| 218 | print("Embedding cache cleared") |
| 219 | |
| 220 | def normalize_vector(vec): |
| 221 | vec = np.array(vec, dtype=np.float32) |
| 222 | norm = np.linalg.norm(vec) |
| 223 | if norm == 0: |
| 224 | return vec |
| 225 | return vec / norm |
| 226 | |
| 227 | # ---- Time Decay Function ---- |
| 228 | def compute_time_decay(event_timestamp_str, current_timestamp_str, tau_hours=24): |
no outgoing calls
no test coverage detected