Instructions to use sthui/SimpleSeg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sthui/SimpleSeg with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="sthui/SimpleSeg", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sthui/SimpleSeg", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| {%- for message in messages -%} | |
| {%- if loop.first and messages[0]['role'] != 'system' -%} | |
| {{'<|im_system|>system<|im_middle|>You are a helpful assistant<|im_end|>'}} | |
| {%- endif -%} | |
| {%- if message['role'] == 'system' -%} | |
| {{'<|im_system|>'}} | |
| {%- endif -%} | |
| {%- if message['role'] == 'user' -%} | |
| {{'<|im_user|>'}} | |
| {%- endif -%} | |
| {%- if message['role'] == 'assistant' -%} | |
| {{'<|im_assistant|>'}} | |
| {%- endif -%} | |
| {{- message['role'] -}} | |
| {{'<|im_middle|>'}} | |
| {%- if message['content'] is string -%} | |
| {{- message['content'] + '<|im_end|>' -}} | |
| {%- else -%} | |
| {%- for content in message['content'] -%} | |
| {%- if content['type'] == 'image' or 'image' in content or 'image_url' in content -%} | |
| {{'<|media_start|>image<|media_content|><|media_pad|><|media_end|>'}} | |
| {%- else -%} | |
| {{content['text']}} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {{'<|im_end|>'}} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt -%} | |
| {{'<|im_assistant|>assistant<|im_middle|>'}} | |
| {%- endif -%} | |