mhenrichsen/context-aware-splits-english
Viewer • Updated • 28k • 23 • 5
How to use mhenrichsen/context-aware-splitter-mistral-eng with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="mhenrichsen/context-aware-splitter-mistral-eng") # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("mhenrichsen/context-aware-splitter-mistral-eng")
model = AutoModelForMultimodalLM.from_pretrained("mhenrichsen/context-aware-splitter-mistral-eng")How to use mhenrichsen/context-aware-splitter-mistral-eng with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "mhenrichsen/context-aware-splitter-mistral-eng"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "mhenrichsen/context-aware-splitter-mistral-eng",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/mhenrichsen/context-aware-splitter-mistral-eng
How to use mhenrichsen/context-aware-splitter-mistral-eng with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "mhenrichsen/context-aware-splitter-mistral-eng" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "mhenrichsen/context-aware-splitter-mistral-eng",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "mhenrichsen/context-aware-splitter-mistral-eng" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "mhenrichsen/context-aware-splitter-mistral-eng",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use mhenrichsen/context-aware-splitter-mistral-eng with Docker Model Runner:
docker model run hf.co/mhenrichsen/context-aware-splitter-mistral-eng
This model is a fine-tuned version of mistralai/Mistral-7B-v0.1 on the mhenrichsen/context-aware-splits-english dataset. It achieves the following results on the evaluation set:
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Your task is to segment text into smaller blocks. Split the text where it makes sense and be vary of the context. The ideal split should be close to {WORD_COUNT} words.
### Input:
Q: Information/File Manager I'm looking for a file manager application which helps to organize a large amount of movies, pictures, music, text documents, databases, audio-books and ebooks. Right now I only use the Finder which doesn't work well, because I really need a function to put single files into multiple categories. Simply using the file system for this creates a confusing nesting of files. A: Depending on the number of categories you require to handle, you could always use a combination of the finder with the built in label functionality, thus a movie can be held in one area (movies directory, for example), but "tagged" as something else. Using smart directories and saved searches you can view your files by a combination of the attributes (location, label, media type) to create custom views. All without purchasing software. Cheap and cheerful, but may be suitable to your needs. A: Maybe use a file manager that supports Open Meta. Or use symbolic links for organizing all your media files. Or even use hardlinked files if you dare.
### Response:
Response:
{'splits': ["Q: Information/File Manager I'm looking for a file manager application which helps to organize a large amount of movies, pictures, music, text documents, databases, audio-books and ebooks. Right now I only use the Finder which doesn't work well, because I really need a function to put single files into multiple categories. Simply using the file system for this creates a confusing nesting of files.", 'A: Depending on the number of categories you require to handle, you could always use a combination of the finder with the built in label functionality, thus a movie can be held in one area (movies directory, for example), but "tagged" as something else. Using smart directories and saved searches you can view your files by a combination of the attributes (location, label, media type) to create custom views. All without purchasing software. Cheap and cheerful, but may be suitable to your needs.', 'A: Maybe use a file manager that supports Open Meta. Or use symbolic links for organizing all your media files. Or even use hardlinked files if you dare.'], 'topic': 'Discussion on file manager applications for organizing large amount of media files.'}
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.1557 | 0.01 | 1 | 0.1552 |
| 0.0936 | 0.05 | 6 | 0.0695 |
| 0.0447 | 0.1 | 12 | 0.0413 |
| 0.0347 | 0.16 | 18 | 0.0357 |
| 0.0314 | 0.21 | 24 | 0.0324 |
| 0.0306 | 0.26 | 30 | 0.0309 |
| 0.0276 | 0.31 | 36 | 0.0294 |
| 0.028 | 0.36 | 42 | 0.0284 |
| 0.0307 | 0.41 | 48 | 0.0281 |
| 0.0276 | 0.47 | 54 | 0.0274 |
| 0.0251 | 0.52 | 60 | 0.0267 |
| 0.0244 | 0.57 | 66 | 0.0269 |
| 0.0268 | 0.62 | 72 | 0.0263 |
| 0.0249 | 0.67 | 78 | 0.0262 |
| 0.0252 | 0.73 | 84 | 0.0258 |
| 0.0259 | 0.78 | 90 | 0.0257 |
| 0.0241 | 0.83 | 96 | 0.0255 |
| 0.0241 | 0.88 | 102 | 0.0254 |
| 0.0253 | 0.93 | 108 | 0.0254 |
| 0.0234 | 0.98 | 114 | 0.0253 |
Base model
mistralai/Mistral-7B-v0.1