Instructions to use SoTrxII/analytical-pattern-embedder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use SoTrxII/analytical-pattern-embedder with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("SoTrxII/analytical-pattern-embedder") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Download chat_template.jinja from SoTrxII/analytical-pattern-embedder: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/SoTrxII/analytical-pattern-embedder/resolve/main/chat_template.jinja
- Command line
-
hf download hf://SoTrxII/analytical-pattern-embedder/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/SoTrxII/analytical-pattern-embedder/resolve/main/chat_template.jinja
1.02 kB
| {%- for msg in messages if msg.get('role') == 'system' -%}{%- if msg.get('content') is string -%}{{ msg['content'] }}{%- else -%}{%- for item in msg['content'] if item.get('type') == 'text' -%}{{ item['text'] }}{%- endfor -%}{%- endif -%}{%- endfor -%}{%- for msg in messages if msg.get('role') != 'system' -%}{%- if msg.get('content') is string -%}{{ msg['content'] }}{%- else -%}{%- set existing_text = msg['content'] | selectattr('type', 'equalto', 'text') | map(attribute='text') | join -%}{%- set has_manual_placeholders = ('<|image|>' in existing_text) or ('<|video|>' in existing_text) or ('<|audio|>' in existing_text) -%}{%- for item in msg['content'] -%}{%- if item.get('type') == 'text' -%}{{ item['text'] }}{%- elif not has_manual_placeholders and item.get('type') == 'image' -%}<|image|>{%- elif not has_manual_placeholders and item.get('type') == 'video' -%}<|video|>{%- elif not has_manual_placeholders and item.get('type') == 'audio' -%}<|audio|>{%- endif -%}{%- endfor -%}{%- endif -%}{%- endfor -%} |