Feature Extraction
sentence-transformers
PyTorch
English
custom_snp
emotional-ai
reasoning-embedding
substrate-prism
cognitive-modeling
Instructions to use 366degrees/snp-universal-embedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use 366degrees/snp-universal-embedding with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("366degrees/snp-universal-embedding") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
File size: 587 Bytes
974c440 c629c02 974c440 c629c02 974c440 c629c02 974c440 297ce93 c629c02 974c440 c629c02 974c440 c629c02 974c440 297ce93 974c440 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Use lightweight Python base
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Copy files
COPY . .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Create cache directory and make it writable for non-root
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
# Set environment variables for Hugging Face cache
ENV HF_HOME=/app/hf_cache
ENV TRANSFORMERS_CACHE=/app/hf_cache
# Expose Space port
EXPOSE 7860
# Switch to non-root user
RUN useradd -m appuser
USER appuser
# Run Flask directly (no Gunicorn)
CMD ["python", "api_inference.py"]
|