Spaces:
Runtime error
Runtime error
Download src/modules/models/index.py from pnstack/template-python: direct link, hf CLI and curl.
- Browser
- Download file 242 Bytes
-
https://huggingface.co/spaces/pnstack/template-python/resolve/43909516e0cf3c8301074a335734d496399a54b9/src/modules/models/index.py
- Command line
-
hf download hf://spaces/pnstack/template-python@43909516e0cf3c8301074a335734d496399a54b9/src/modules/models/index.py
-
curl -L -o index.py https://huggingface.co/spaces/pnstack/template-python/resolve/43909516e0cf3c8301074a335734d496399a54b9/src/modules/models/index.py
242 Bytes
| from sentence_transformers import SentenceTransformer | |
| # Load embedding model once when the server starts | |
| model = SentenceTransformer("all-MiniLM-L6-v2") | |
| def embed_text(req): | |
| embedding = model.encode(req).tolist() | |
| return embedding | |