Instructions to use Philipp-Sc/mistral-7b-reverse-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Philipp-Sc/mistral-7b-reverse-instruct with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Philipp-Sc/mistral-7b-reverse-instruct:F16 # Run inference directly in the terminal: llama cli -hf Philipp-Sc/mistral-7b-reverse-instruct:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Philipp-Sc/mistral-7b-reverse-instruct:F16 # Run inference directly in the terminal: llama cli -hf Philipp-Sc/mistral-7b-reverse-instruct:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Philipp-Sc/mistral-7b-reverse-instruct:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf Philipp-Sc/mistral-7b-reverse-instruct:F16
Use Docker
docker model run hf.co/Philipp-Sc/mistral-7b-reverse-instruct:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use Philipp-Sc/mistral-7b-reverse-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Philipp-Sc/mistral-7b-reverse-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Philipp-Sc/mistral-7b-reverse-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Philipp-Sc/mistral-7b-reverse-instruct:F16
- Ollama
How to use Philipp-Sc/mistral-7b-reverse-instruct with Ollama:
ollama run hf.co/Philipp-Sc/mistral-7b-reverse-instruct:F16
- Unsloth Desktop
- Docker Model Runner
How to use Philipp-Sc/mistral-7b-reverse-instruct with Docker Model Runner:
docker model run hf.co/Philipp-Sc/mistral-7b-reverse-instruct:F16
- Lemonade
How to use Philipp-Sc/mistral-7b-reverse-instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Philipp-Sc/mistral-7b-reverse-instruct:F16
Run and chat with the model
lemonade run user.mistral-7b-reverse-instruct-F16
List all available models
lemonade list
- Atomic Chat
Commit ·
532ff8b
1
Parent(s): e0c18c2
Update README.md
Browse files1 unmodified line23456789101 unmodified line12131412151617181619202116 unmodified lines3839403940414243414243444546474849505152535455485657585960616263646566675051686970537172736 unmodified lines80818266838485688687888972909192931 unmodified line95969798991001011 unmodified linelicense: apache-2.0datasets:- pankajmathur/WizardLM_Orca- teknium/trismegistus-project- unalignment/toxic-dpo-v0.1- Intel/orca_dpo_pairslanguage:- enpipeline_tag: text-generation1 unmodified line
## Mistral 7b Reverse Instruct
This model is LoRA fine tuned to reverse engineer the original prompt of a given LLM output/response. This model is sft (LoRA) fine tuned to reverse engineer the original prompt of a given LLM output/response. Use Case: The generation of synthetic instruct datasets for developing chatbots and domain specific fine tuning (e.g. "Summarization" & "Roleplay").
- base_model: mistralai/Mistral-7B-v0.1 (=checkpoint-v1)- base_model: mistralai/Mistral-7B-v0.2 (>=checkpoint-v2)
16 unmodified lines
About 21k items of the following datasets were used. (mostly coding-like tasks were removed)
```bashwget https://raw.githubusercontent.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM/main/data/alpaca_gpt4_data.jsonwget https://raw.githubusercontent.com/teknium1/GPTeacher/main/Roleplay%20Supplemental/roleplay-instruct-v2.1.jsonwget https://huggingface.co/datasets/pankajmathur/WizardLM_Orca/resolve/main/wizardlm_orca.json```- v1 & v2: [reverse-instruct_v1.json](https://huggingface.co/Philipp-Sc/mistral-7b-reverse-instruct/blob/main/reverse-instruct_v1.json)- v3: [reverse-instruct_v2.json](https://huggingface.co/Philipp-Sc/mistral-7b-reverse-instruct/blob/main/reverse-instruct_v2.json)
The reverse instruct dataset has been compiled with entries from the following datasets:
- [alpaca_gpt4_data](https://raw.githubusercontent.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM/main/data/alpaca_gpt4_data.json)- [roleplay-instruct-v2.1](https://raw.githubusercontent.com/teknium1/GPTeacher/main/Roleplay%20Supplemental/roleplay-instruct-v2.1.json)- [wizardlm_orca](https://huggingface.co/datasets/pankajmathur/WizardLM_Orca/resolve/main/wizardlm_orca.json)- [toxic-dpo-v0.1](https://huggingface.co/datasets/unalignment/toxic-dpo-v0.1/resolve/main/toxic-dpo.parquet)- [orca_dpo_pairs](https://huggingface.co/datasets/Intel/orca_dpo_pairs/resolve/main/orca_rlhf.jsonl)- [occultexpert](https://huggingface.co/datasets/teknium/trismegistus-project/resolve/main/occultexpert.json)
## Training Procedure
```bashCUDA_VISIBLE_DEVICES=0 WANDB_DISABLED=True python LLaMA-Factory/src/train_bash.py \!cd LLaMA-Factory && WANDB_DISABLED=True PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:256 accelerate launch \ --multi_gpu \ --mixed_precision fp16 \ --num_processes 2 \ --num_machines 1 \ --rdzv_backend static \ --same_network \ --gpu_ids all \ --machine_rank 0 \ --main_training_function main \ -- src/train_bash.py \ --stage sft \ --model_name_or_path model_name_or_path \ --checkpoint_dir checkpoint_dir \ --model_name_or_path mistralai/Mistral-7B-Instruct-v0.2 \ --adapter_name_or_path path_to_checkpoint \ --flash_attn \ --shift_attn \ --neftune_noise_alpha 5 \ --do_train \ --dataset default \6 unmodified lines --gradient_accumulation_steps 1 \ --lr_scheduler_type cosine \ --logging_steps 10 \ --save_steps 100 \ --save_steps 10 \ --save_total_limit 3 \ --learning_rate 5e-5 \ --num_train_epochs 3.0 \ --num_train_epochs 9.0 \ --plot_loss \ --fp16 \ --overwrite_output_dir \ --cutoff_len 2048 \ --cutoff_len 4096 \ --quantization_bit 4```
1 unmodified line
- v1: ~12h on Kaggle's P100 GPU- v2: >30h on Kaggle's T4 x2- v3: coming soon
### Framework versions
README.md+33-14