cnbeining/sentence-segmentation-dpo-raw
Viewer • Updated • 9.18k • 104
How to use cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation", dtype="auto")How to use cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="cnbeining/OpenHermes-2.5-Mistral-7B-Sentence-Segmentation",
max_seq_length=2048,
)See files for original notebook used for finetuning
OpenHermes-2.5-Mistral-7B-Sentence-Segmentation is a DPO finetuned OpenHermes model for sentence segmentation capability.
This model is based on teknium/OpenHermes-2.5-Mistral-7B, a state-of-the-art chat-aligned 7B model.
The model has been finetuned with (ChatML)[https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/ai-services/openai/includes/chat-markup-language.md#messages] template:
<|im_start|>system
Segment:<|im_end|>
<|im_start|>user
```yaml
"input":
"sentence":
"segment":
- "word": "Shere,"
- "word": "in"
- "word": "your"
- "word": "report"
- "word": "on"
- "word": "female"
- "word": "sexuality,"
- "word": "men"
- "word": "were"
- "word": "staggered"
- "word": "to"
- "word": "learn"
- "word": "that"
- "word": "clitoral"
- "word": "stimulation"
- "word": "was"
- "word": "much"
- "word": "more"
- "word": "important"
- "word": "than"
- "word": "penetration."
```<|im_end|>
<|im_start|>assistant
with output in the format of
```yaml
"output":
"sentence":
"segment":
- "word": "Shere,"
- "word": "in"
- "word": "your"
- "word": "report"
- "word": "on"
- "word": "female"
- "word": "sexuality,"
"segment":
- "word": "men"
- "word": "were"
- "word": "staggered"
- "word": "to"
- "word": "learn"
- "word": "that"
"segment":
- "word": "clitoral"
- "word": "stimulation"
- "word": "was"
- "word": "much"
- "word": "more"
- "word": "important"
- "word": "than"
- "word": "penetration."
## Misc
This mistral model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
Base model
mistralai/Mistral-7B-v0.1