Spaces:
Sleeping
Sleeping
Download rag/vector_format.py from Meshyboi/Intach-Pune: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/spaces/Meshyboi/Intach-Pune/resolve/main/rag/vector_format.py
- Command line
-
hf download hf://spaces/Meshyboi/Intach-Pune/rag/vector_format.py
-
curl -L -o vector_format.py https://huggingface.co/spaces/Meshyboi/Intach-Pune/resolve/main/rag/vector_format.py
348 Bytes
| from __future__ import annotations | |
| def to_pgvector_literal(embedding: list[float]) -> str: | |
| """Formats a Python float list as a pgvector text literal, e.g. '[0.1,0.2]', | |
| for use with an explicit ::vector cast in raw SQL (no pgvector client | |
| library needed for this).""" | |
| return "[" + ",".join(str(value) for value in embedding) + "]" | |