GraySoft
Projects Models About FAQ Contact Download guIDE →
Model Intelligence Sheet

thebloke/bagel-dpo-7b-v0.1-gguf overview

Comprehensive model page for thebloke/bagel-dpo-7b-v0.1-gguf

transformersggufmistraldataset:ai2_arcdataset:unalignment/spicy-3.1dataset:codeparrot/appsdataset:facebook/belebeledataset:boolqdataset:jondurbin/cinematika-v0.1dataset:dropdataset:lmsys/lmsys-chat-1mdataset:TIGER-Lab/MathInstructdataset:cais/mmludataset:Muennighoff/natural-instructionsdataset:openbookqadataset:piqadataset:Vezora/Tested-22k-Python-Alpacadataset:cakiki/rosetta-codedataset:Open-Orca/SlimOrcadataset:spiderdataset:squad_v2dataset:migtissera/Synthia-v1.3dataset:datasets/winograndedataset:nvidia/HelpSteerdataset:Intel/orca_dpo_pairsdataset:unalignment/toxic-dpo-v0.1dataset:jondurbin/truthy-dpo-v0.1dataset:allenai/ultrafeedback_binarized_cleanedbase_model:jondurbin/bagel-dpo-7b-v0.1base_model:quantized:jondurbin/bagel-dpo-7b-v0.1
thebloke/bagel-dpo-7b-v0.1-gguf visual
Downloads
370
Likes
5
Pipeline
Library
transformers
Visibility
Public
Access
Open

Repository Files & Downloads

12 files detected
Direct downloads for all repository files
FileTypeQuantizationSizeLink
bagel-dpo-7b-v0.1.Q2_K.gguf GGUF Q2_K 2.87 GB Download
bagel-dpo-7b-v0.1.Q3_K_L.gguf GGUF Q3_K_L 3.56 GB Download
bagel-dpo-7b-v0.1.Q3_K_M.gguf GGUF Q3_K_M 3.28 GB Download
bagel-dpo-7b-v0.1.Q3_K_S.gguf GGUF Q3_K_S 2.95 GB Download
bagel-dpo-7b-v0.1.Q4_0.gguf GGUF 3.83 GB Download
bagel-dpo-7b-v0.1.Q4_K_M.gguf GGUF Q4_K_M 4.07 GB Download
bagel-dpo-7b-v0.1.Q4_K_S.gguf GGUF Q4_K_S 3.86 GB Download
bagel-dpo-7b-v0.1.Q5_0.gguf GGUF 4.65 GB Download
bagel-dpo-7b-v0.1.Q5_K_M.gguf GGUF Q5_K_M 4.78 GB Download
bagel-dpo-7b-v0.1.Q5_K_S.gguf GGUF Q5_K_S 4.65 GB Download
bagel-dpo-7b-v0.1.Q6_K.gguf GGUF Q6_K 5.53 GB Download
bagel-dpo-7b-v0.1.Q8_0.gguf GGUF 7.17 GB Download

Model Details Live

Model Slug
thebloke/bagel-dpo-7b-v0.1-gguf
Author
TheBloke
Pipeline Task
Library
transformers
Created
2023-12-13
Last Modified
2023-12-13
Gated
No
Private
No
HF SHA
465cbdf3ea266741d7b17e4ec1cd1de3e6ed3f1b
License
apache-2.0
Language
Unknown
Base Model
jondurbin/bagel-dpo-7b-v0.1

Metadata Inspector

Normalized metadata (stored in metadata_json)
{
  "metadata": {},
  "card_data": {
    "base_model": "jondurbin/bagel-dpo-7b-v0.1",
    "datasets": [
      "ai2_arc",
      "unalignment/spicy-3.1",
      "codeparrot/apps",
      "facebook/belebele",
      "boolq",
      "jondurbin/cinematika-v0.1",
      "drop",
      "lmsys/lmsys-chat-1m",
      "TIGER-Lab/MathInstruct",
      "cais/mmlu",
      "Muennighoff/natural-instructions",
      "openbookqa",
      "piqa",
      "Vezora/Tested-22k-Python-Alpaca",
      "cakiki/rosetta-code",
      "Open-Orca/SlimOrca",
      "spider",
      "squad_v2",
      "migtissera/Synthia-v1.3",
      "datasets/winogrande",
      "nvidia/HelpSteer",
      "Intel/orca_dpo_pairs",
      "unalignment/toxic-dpo-v0.1",
      "jondurbin/truthy-dpo-v0.1",
      "allenai/ultrafeedback_binarized_cleaned"
    ],
    "inference": false,
    "license": "apache-2.0",
    "model_creator": "Jon Durbin",
    "model_name": "Bagel DPO 7B v0.1",
    "model_type": "mistral",
    "prompt_template": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{prompt}\n\n### Response:\n",
    "quantized_by": "TheBloke",
    "frontmatter": {
      "base_model": "jondurbin/bagel-dpo-7b-v0.1",
      "datasets": [
        "ai2_arc",
        "unalignment/spicy-3.1",
        "codeparrot/apps",
        "facebook/belebele",
        "boolq",
        "jondurbin/cinematika-v0.1",
        "drop",
        "lmsys/lmsys-chat-1m",
        "TIGER-Lab/MathInstruct",
        "cais/mmlu",
        "Muennighoff/natural-instructions",
        "openbookqa",
        "piqa",
        "Vezora/Tested-22k-Python-Alpaca",
        "cakiki/rosetta-code",
        "Open-Orca/SlimOrca",
        "spider",
        "squad_v2",
        "migtissera/Synthia-v1.3",
        "datasets/winogrande",
        "nvidia/HelpSteer",
        "Intel/orca_dpo_pairs",
        "unalignment/toxic-dpo-v0.1",
        "jondurbin/truthy-dpo-v0.1",
        "allenai/ultrafeedback_binarized_cleaned"
      ],
      "inference": "false",
      "license": "apache-2.0",
      "model_creator": "Jon Durbin",
      "model_name": "Bagel DPO 7B v0.1",
      "model_type": "mistral",
      "prompt_template": "'Below is an instruction that describes a task. Write a response",
      "quantized_by": "TheBloke"
    },
    "hero_image_url": "https://i.imgur.com/EBdldam.jpg",
    "summary": "",
    "quick_links": [],
    "benchmark_table_html": "",
    "readme_markdown": "---\nbase_model: jondurbin/bagel-dpo-7b-v0.1\ndatasets:\n- ai2_arc\n- unalignment/spicy-3.1\n- codeparrot/apps\n- facebook/belebele\n- boolq\n- jondurbin/cinematika-v0.1\n- drop\n- lmsys/lmsys-chat-1m\n- TIGER-Lab/MathInstruct\n- cais/mmlu\n- Muennighoff/natural-instructions\n- openbookqa\n- piqa\n- Vezora/Tested-22k-Python-Alpaca\n- cakiki/rosetta-code\n- Open-Orca/SlimOrca\n- spider\n- squad_v2\n- migtissera/Synthia-v1.3\n- datasets/winogrande\n- nvidia/HelpSteer\n- Intel/orca_dpo_pairs\n- unalignment/toxic-dpo-v0.1\n- jondurbin/truthy-dpo-v0.1\n- allenai/ultrafeedback_binarized_cleaned\ninference: false\nlicense: apache-2.0\nmodel_creator: Jon Durbin\nmodel_name: Bagel DPO 7B v0.1\nmodel_type: mistral\nprompt_template: 'Below is an instruction that describes a task. Write a response\n  that appropriately completes the request.\n\n\n  ### Instruction:\n\n  {prompt}\n\n\n  ### Response:\n\n  '\nquantized_by: TheBloke\n---\n<!-- markdownlint-disable MD041 -->\n\n<!-- header start -->\n<!-- 200823 -->\n<div style=\"width: auto; margin-left: auto; margin-right: auto\">\n<img src=\"https://i.imgur.com/EBdldam.jpg\" alt=\"TheBlokeAI\" style=\"width: 100%; min-width: 400px; display: block; margin: auto;\">\n</div>\n<div style=\"display: flex; justify-content: space-between; width: 100%;\">\n    <div style=\"display: flex; flex-direction: column; align-items: flex-start;\">\n        <p style=\"margin-top: 0.5em; margin-bottom: 0em;\"><a href=\"https://discord.gg/theblokeai\">Chat & support: TheBloke's Discord server</a></p>\n    </div>\n    <div style=\"display: flex; flex-direction: column; align-items: flex-end;\">\n        <p style=\"margin-top: 0.5em; margin-bottom: 0em;\"><a href=\"https://www.patreon.com/TheBlokeAI\">Want to contribute? TheBloke's Patreon page</a></p>\n    </div>\n</div>\n<div style=\"text-align:center; margin-top: 0em; margin-bottom: 0em\"><p style=\"margin-top: 0.25em; margin-bottom: 0em;\">TheBloke's LLM work is generously supported by a grant from <a href=\"https://a16z.com\">andreessen horowitz (a16z)</a></p></div>\n<hr style=\"margin-top: 1.0em; margin-bottom: 1.0em;\">\n<!-- header end -->\n\n# Bagel DPO 7B v0.1 - GGUF\n- Model creator: [Jon Durbin](https://huggingface.co/jondurbin)\n- Original model: [Bagel DPO 7B v0.1](https://huggingface.co/jondurbin/bagel-dpo-7b-v0.1)\n\n<!-- description start -->\n## Description\n\nThis repo contains GGUF format model files for [Jon Durbin's Bagel DPO 7B v0.1](https://huggingface.co/jondurbin/bagel-dpo-7b-v0.1).\n\nThese files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).\n\n<!-- description end -->\n<!-- README_GGUF.md-about-gguf start -->\n### About GGUF\n\nGGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.\n\nHere is an incomplete list of clients and libraries that are known to support GGUF:\n\n* [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.\n* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.\n* [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.\n* [GPT4All](https://gpt4all.io/index.html), a free and open source local running GUI, supporting Windows, Linux and macOS with full GPU accel.\n* [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration. Linux available, in beta as of 27/11/2023.\n* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.\n* [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.\n* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.\n* [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.\n* [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server. Note, as of time of writing (November 27th 2023), ctransformers has not been updated in a long time and does not support many recent models.\n\n<!-- README_GGUF.md-about-gguf end -->\n<!-- repositories-available start -->\n## Repositories available\n\n* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-AWQ)\n* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GPTQ)\n* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF)\n* [Jon Durbin's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/jondurbin/bagel-dpo-7b-v0.1)\n<!-- repositories-available end -->\n\n<!-- prompt-template start -->\n## Prompt template: Alpaca\n\n```\nBelow is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{prompt}\n\n### Response:\n\n```\n\n<!-- prompt-template end -->\n\n\n<!-- compatibility_gguf start -->\n## Compatibility\n\nThese quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)\n\nThey are also compatible with many third party UIs and libraries - please see the list at the top of this README.\n\n## Explanation of quantisation methods\n\n<details>\n  <summary>Click to see details</summary>\n\nThe new methods available are:\n\n* GGML_TYPE_Q2_K - \"type-1\" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)\n* GGML_TYPE_Q3_K - \"type-0\" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.\n* GGML_TYPE_Q4_K - \"type-1\" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.\n* GGML_TYPE_Q5_K - \"type-1\" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw\n* GGML_TYPE_Q6_K - \"type-0\" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw\n\nRefer to the Provided Files table below to see what files use which methods, and how.\n</details>\n<!-- compatibility_gguf end -->\n\n<!-- README_GGUF.md-provided-files start -->\n## Provided files\n\n| Name | Quant method | Bits | Size | Max RAM required | Use case |\n| ---- | ---- | ---- | ---- | ---- | ----- |\n| [bagel-dpo-7b-v0.1.Q2_K.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q2_K.gguf) | Q2_K | 2 | 3.08 GB| 5.58 GB | smallest, significant quality loss - not recommended for most purposes |\n| [bagel-dpo-7b-v0.1.Q3_K_S.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q3_K_S.gguf) | Q3_K_S | 3 | 3.16 GB| 5.66 GB | very small, high quality loss |\n| [bagel-dpo-7b-v0.1.Q3_K_M.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q3_K_M.gguf) | Q3_K_M | 3 | 3.52 GB| 6.02 GB | very small, high quality loss |\n| [bagel-dpo-7b-v0.1.Q3_K_L.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q3_K_L.gguf) | Q3_K_L | 3 | 3.82 GB| 6.32 GB | small, substantial quality loss |\n| [bagel-dpo-7b-v0.1.Q4_0.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q4_0.gguf) | Q4_0 | 4 | 4.11 GB| 6.61 GB | legacy; small, very high quality loss - prefer using Q3_K_M |\n| [bagel-dpo-7b-v0.1.Q4_K_S.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q4_K_S.gguf) | Q4_K_S | 4 | 4.14 GB| 6.64 GB | small, greater quality loss |\n| [bagel-dpo-7b-v0.1.Q4_K_M.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q4_K_M.gguf) | Q4_K_M | 4 | 4.37 GB| 6.87 GB | medium, balanced quality - recommended |\n| [bagel-dpo-7b-v0.1.Q5_0.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q5_0.gguf) | Q5_0 | 5 | 5.00 GB| 7.50 GB | legacy; medium, balanced quality - prefer using Q4_K_M |\n| [bagel-dpo-7b-v0.1.Q5_K_S.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q5_K_S.gguf) | Q5_K_S | 5 | 5.00 GB| 7.50 GB | large, low quality loss - recommended |\n| [bagel-dpo-7b-v0.1.Q5_K_M.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q5_K_M.gguf) | Q5_K_M | 5 | 5.13 GB| 7.63 GB | large, very low quality loss - recommended |\n| [bagel-dpo-7b-v0.1.Q6_K.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q6_K.gguf) | Q6_K | 6 | 5.94 GB| 8.44 GB | very large, extremely low quality loss |\n| [bagel-dpo-7b-v0.1.Q8_0.gguf](https://huggingface.co/TheBloke/bagel-dpo-7B-v0.1-GGUF/blob/main/bagel-dpo-7b-v0.1.Q8_0.gguf) | Q8_0 | 8 | 7.70 GB| 10.20 GB | very large, extremely low quality loss - not recommended |\n\n**Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.\n\n\n\n<!-- README_GGUF.md-provided-files end -->\n\n<!-- README_GGUF.md-how-to-download start -->\n## How to download GGUF files\n\n**Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.\n\nThe following clients/libraries will automatically download models for you, providing a list of available models to choose from:\n\n* LM Studio\n* LoLLMS Web UI\n* Faraday.dev\n\n### In `text-generation-webui`\n\nUnder Download Model, you can enter the model repo: TheBloke/bagel-dpo-7B-v0.1-GGUF and below it, a specific filename to download, such as: bagel-dpo-7b-v0.1.Q4_K_M.gguf.\n\nThen click Download.\n\n### On the command line, including multiple files at once\n\nI recommend using the `huggingface-hub` Python library:\n\n```shell\npip3 install huggingface-hub\n```\n\nThen you can download any individual model file to the current directory, at high speed, with a command like this:\n\n```shell\nhuggingface-cli download TheBloke/bagel-dpo-7B-v0.1-GGUF bagel-dpo-7b-v0.1.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False\n```\n\n<details>\n  <summary>More advanced huggingface-cli download usage (click to read)</summary>\n\nYou can also download multiple files at once with a pattern:\n\n```shell\nhuggingface-cli download TheBloke/bagel-dpo-7B-v0.1-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'\n```\n\nFor more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).\n\nTo accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:\n\n```shell\npip3 install hf_transfer\n```\n\nAnd set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:\n\n```shell\nHF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/bagel-dpo-7B-v0.1-GGUF bagel-dpo-7b-v0.1.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False\n```\n\nWindows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.\n</details>\n<!-- README_GGUF.md-how-to-download end -->\n\n<!-- README_GGUF.md-how-to-run start -->\n## Example `llama.cpp` command\n\nMake sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.\n\n```shell\n./main -ngl 35 -m bagel-dpo-7b-v0.1.Q4_K_M.gguf --color -c 32768 --temp 0.7 --repeat_penalty 1.1 -n -1 -p \"Below is an instruction that describes a task. Write a response that appropriately completes the request.\\n\\n### Instruction:\\n{prompt}\\n\\n### Response:\"\n```\n\nChange `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.\n\nChange `-c 32768` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.\n\nIf you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`\n\nFor other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)\n\n## How to run in `text-generation-webui`\n\nFurther instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20%E2%80%90%20Model%20Tab.md#llamacpp).\n\n## How to run from Python code\n\nYou can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.\n\n### How to load this model in Python code, using llama-cpp-python\n\nFor full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).\n\n#### First install the package\n\nRun one of the following commands, according to your system:\n\n```shell\n# Base ctransformers with no GPU acceleration\npip install llama-cpp-python\n# With NVidia CUDA acceleration\nCMAKE_ARGS=\"-DLLAMA_CUBLAS=on\" pip install llama-cpp-python\n# Or with OpenBLAS acceleration\nCMAKE_ARGS=\"-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS\" pip install llama-cpp-python\n# Or with CLBLast acceleration\nCMAKE_ARGS=\"-DLLAMA_CLBLAST=on\" pip install llama-cpp-python\n# Or with AMD ROCm GPU acceleration (Linux only)\nCMAKE_ARGS=\"-DLLAMA_HIPBLAS=on\" pip install llama-cpp-python\n# Or with Metal GPU acceleration for macOS systems only\nCMAKE_ARGS=\"-DLLAMA_METAL=on\" pip install llama-cpp-python\n\n# In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:\n$env:CMAKE_ARGS = \"-DLLAMA_OPENBLAS=on\"\npip install llama-cpp-python\n```\n\n#### Simple llama-cpp-python example code\n\n```python\nfrom llama_cpp import Llama\n\n# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.\nllm = Llama(\n  model_path=\"./bagel-dpo-7b-v0.1.Q4_K_M.gguf\",  # Download the model file first\n  n_ctx=32768,  # The max sequence length to use - note that longer sequence lengths require much more resources\n  n_threads=8,            # The number of CPU threads to use, tailor to your system and the resulting performance\n  n_gpu_layers=35         # The number of layers to offload to GPU, if you have GPU acceleration available\n)\n\n# Simple inference example\noutput = llm(\n  \"Below is an instruction that describes a task. Write a response that appropriately completes the request.\\n\\n### Instruction:\\n{prompt}\\n\\n### Response:\", # Prompt\n  max_tokens=512,  # Generate up to 512 tokens\n  stop=[\"</s>\"],   # Example stop token - not necessarily correct for this specific model! Please check before using.\n  echo=True        # Whether to echo the prompt\n)\n\n# Chat Completion API\n\nllm = Llama(model_path=\"./bagel-dpo-7b-v0.1.Q4_K_M.gguf\", chat_format=\"llama-2\")  # Set chat_format according to the model you are using\nllm.create_chat_completion(\n    messages = [\n        {\"role\": \"system\", \"content\": \"You are a story writing assistant.\"},\n        {\n            \"role\": \"user\",\n            \"content\": \"Write a story about llamas.\"\n        }\n    ]\n)\n```\n\n## How to use with LangChain\n\nHere are guides on using llama-cpp-python and ctransformers with LangChain:\n\n* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)\n* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)\n\n<!-- README_GGUF.md-how-to-run end -->\n\n<!-- footer start -->\n<!-- 200823 -->\n## Discord\n\nFor further support, and discussions on these models and AI in general, join us at:\n\n[TheBloke AI's Discord server](https://discord.gg/theblokeai)\n\n## Thanks, and how to contribute\n\nThanks to the [chirper.ai](https://chirper.ai) team!\n\nThanks to Clay from [gpus.llm-utils.org](llm-utils)!\n\nI've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.\n\nIf you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.\n\nDonaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.\n\n* Patreon: https://patreon.com/TheBlokeAI\n* Ko-Fi: https://ko-fi.com/TheBlokeAI\n\n**Special thanks to**: Aemon Algiz.\n\n**Patreon special mentions**: Michael Levine, 阿明, Trailburnt, Nikolai Manek, John Detwiler, Randy H, Will Dee, Sebastain Graf, NimbleBox.ai, Eugene Pentland, Emad Mostaque, Ai Maven, Jim Angel, Jeff Scroggin, Michael Davis, Manuel Alberto Morcote, Stephen Murray, Robert, Justin Joy, Luke @flexchar, Brandon Frisco, Elijah Stavena, S_X, Dan Guido, Undi ., Komninos Chatzipapas, Shadi, theTransient, Lone Striker, Raven Klaugh, jjj, Cap'n Zoog, Michel-Marie MAUDET (LINAGORA), Matthew Berman, David, Fen Risland, Omer Bin Jawed, Luke Pendergrass, Kalila, OG, Erik Bjäreholt, Rooh Singh, Joseph William Delisle, Dan Lewis, TL, John Villwock, AzureBlack, Brad, Pedro Madruga, Caitlyn Gatomon, K, jinyuan sun, Mano Prime, Alex, Jeffrey Morgan, Alicia Loh, Illia Dulskyi, Chadd, transmissions 11, fincy, Rainer Wilmers, ReadyPlayerEmma, knownsqashed, Mandus, biorpg, Deo Leter, Brandon Phillips, SuperWojo, Sean Connelly, Iucharbius, Jack West, Harry Royden McLaughlin, Nicholas, terasurfer, Vitor Caleffi, Duane Dunston, Johann-Peter Hartmann, David Ziegler, Olakabola, Ken Nordquist, Trenton Dambrowitz, Tom X Nguyen, Vadim, Ajan Kanaga, Leonard Tan, Clay Pascal, Alexandros Triantafyllidis, JM33133, Xule, vamX, ya boyyy, subjectnull, Talal Aujan, Alps Aficionado, wassieverse, Ari Malik, James Bentley, Woland, Spencer Kim, Michael Dempsey, Fred von Graf, Elle, zynix, William Richards, Stanislav Ovsiannikov, Edmond Seymore, Jonathan Leane, Martin Kemka, usrbinkat, Enrico Ros\n\n\nThank you to all my generous patrons and donaters!\n\nAnd thank you again to a16z for their generous grant.\n\n<!-- footer end -->\n\n<!-- original-model-card start -->\n# Original model card: Jon Durbin's Bagel DPO 7B v0.1\n\n\n# A bagel, with everything\n\n![bagel](bagel.png)\n\n## Overview\n\nThis is the DPO'd version of https://huggingface.co/jondurbin/bagel-7b-v0.1\n\nIf you are getting too many AALLM or other refusals, even with explicitly human system prompts, you may want to try the non-DPO version.\n\n## Benchmarks\n\nI ran these against the latest main branch of lm-evaluation-harness (and opencompass/FastChat for agieval and mt-bench), since batch size/etc effects score for some benchmarks.\n\n| model | arc_challenge | boolq | gsm8k | hellaswag | mmlu | openbookqa | piqa | truthful_qa | winogrande |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| bagel | __0.6715__ | 0.8813 | __0.5618__ | 0.8397 | __0.6408__ | __0.51__ | __0.8406__ | __0.6275__ | __0.7561__ |\n| openhermes-2.5 | 0.6476 | __0.8835__ | 0.4852 | __0.8414__ | 0.6347 | 0.498 | 0.8400 | 0.5295 | 0.7443 |\n\n\nMT-Bench:\n```\n########## First turn ##########\n                      score\nmodel         turn\nbagel-7b-v0.1 1     7.60625\n\n########## Second turn ##########\n                      score\nmodel         turn\nbagel-7b-v0.1 2     7.00625\n\n########## Average ##########\n                 score\nmodel\nbagel-7b-v0.1  7.30625\n```\n\n## Data selection.\n\nThe first step in the process is creating a dataset.\nIn this case, we're actually creating a composite dataset, consisting of both supervised fine-tuning data (SFT) and direct preference optimization (DPO) data.\n\nAll instruction data, that is, data that is not plain text (like project Gutenberg and items from Cinematika) or DPO, is converted into ShareGPT format so it's easier to work with.\n\nSee the corresponding code in `bagel/data_sources/*.py` for full implementation for each data source.\n\nDeduplication is done by creating a uuid v5 of the instruction/text, then only adding items not previously seen (where datasets are loaded in order of the confidence score I assign them).\nThis means that if an instruction is in data source \"Foo\" with confidence 4 as well as in data source \"Bar\" with confidence score 2, only the entry from \"Foo\" will be taken.\n\n### SFT data sources\n\n*Yes, you will see benchmark names in the list, but this only uses the train splits, and a decontamination by cosine similarity is performed at the end as a sanity check*\n\n- [ai2_arc](https://huggingface.co/datasets/ai2_arc)\n  - Abstraction and reasoning dataset, useful in measuring \"intelligence\" to a certain extent.\n- [airoboros](https://huggingface.co/datasets/unalignment/spicy-3.1)\n  - Variety of categories of synthetic instructions generated by gpt-4.\n- [apps](https://huggingface.co/datasets/codeparrot/apps)\n  - Python coding dataset with 10k problems.\n- [belebele](https://huggingface.co/datasets/facebook/belebele)\n  - Multi-lingual reading comprehension dataset.\n- [boolq](https://huggingface.co/datasets/boolq)\n  - Corpus of yes/no questions (which can be surprisingly difficult for AI to answer apparently?)\n- [cinematika](https://huggingface.co/datasets/jondurbin/cinematika-v0.1) (instruction and plain text)\n  - RP-style data synthesized from movie scripts so the model isn't quite as boring as it otherwise would be.\n- [drop](https://huggingface.co/datasets/drop)\n  - More reading comprehension.\n- [gutenberg](https://www.gutenberg.org/) (plain text)\n  - Books/plain text, again to make the model less boring, only a handful of examples supported by [chapterize](https://github.com/JonathanReeve/chapterize)\n- [lmsys_chat_1m](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) (only gpt-4 items, also used for DPO)\n  - Chats collected by the lmsys chat arena, containing a wide variety of chats with various models.\n- [mathinstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)\n  - Composite dataset with a variety of math-related tasks and problem/question formats.\n- [mmlu](https://huggingface.co/datasets/cais/mmlu)\n  - Massive Multitask Language Understanding - a wide variety of questions about various subject matters.\n- [natural_instructions](https://huggingface.co/datasets/Muennighoff/natural-instructions)\n  - Millions of instructions from 1600+ task categories (sampled down substantially, stratified by task type)\n- [openbookqa](https://huggingface.co/datasets/openbookqa)\n  - Question answering dataset.\n- [piqa](https://huggingface.co/datasets/piqa)\n  - Phyiscal interaction question answering.\n- [python_alpaca](https://huggingface.co/datasets/Vezora/Tested-22k-Python-Alpaca)\n  - Python instruction response pairs, validated as functional.\n- [rosetta_code](https://huggingface.co/datasets/cakiki/rosetta-code)\n  - Code problems and solutions in a variety of programming languages taken from rosettacode.org.\n- [slimorca](https://huggingface.co/datasets/Open-Orca/SlimOrca)\n  - Collection of ~500k gpt-4 verified chats from OpenOrca.\n- [spider](https://huggingface.co/datasets/spider)\n  - SQL-targeted dataset.\n- [squad_v2](https://huggingface.co/datasets/squad_v2)\n  - Contextual question answering (RAG).\n- [synthia](https://huggingface.co/datasets/migtissera/Synthia-v1.3)\n  - GPT-4 generated data using advanced prompting from Migel Tissera.\n- [winogrande](https://huggingface.co/datasets/winogrande)\n  - Fill in the blank style prompts.\n\n### DPO data sources\n- [airoboros 3.1](https://huggingface.co/datasets/unalignment/spicy-3.1) vs [airoboros 2.2.1](https://huggingface.co/datasets/jondurbin/airoboros-gpt4-1.4.1)\n  - The creative/writing tasks from airoboros-2.2.1 were re-generated using gpt4-0314 and a custom prompt to get longer, more creative, less clichè responses for airoboros 3.1, so we can use the shorter/boring version as the \"rejected\" value and the rerolled response as \"chosen\"\n- [helpsteer](https://huggingface.co/datasets/nvidia/HelpSteer)\n  - Really neat dataset provided by the folks at NVidia with human annotation across a variety of metrics.  Only items with the highest \"correctness\" value were used for DPO here, with the highest scoring output as \"chosen\" and random lower scoring value as \"rejected\"\n- [orca_dpo_pairs](https://huggingface.co/datasets/Intel/orca_dpo_pairs)\n  - Another interesting dataset by Intel, which provides various DPO pairs generated from prompts included in the SlimOrca dataset.\n- [toxic-dpo](https://huggingface.co/datasets/unalignment/toxic-dpo-v0.1)\n  - __*highly toxic and potentially illegal content!*__ De-censorship, for academic and lawful purposes only, of course.  Generated by llama-2-70b via prompt engineering.\n- [truthy](https://huggingface.co/datasets/jondurbin/truthy-dpo-v0.1)\n  - DPO pairs meant to increase truthfulness of the model, e.g. common misconceptions, differentiate between AI assistants and roleplayed human in terms of corporeal awareness/locality/etc.\n- [ultrafeedback](https://huggingface.co/datasets/allenai/ultrafeedback_binarized_cleaned)\n  - One of the bits of magic behind the Zephyr model.  Only the items with a chosen score of 8 or higher were included.\n\nOnly the train splits were used (if a split was provided), and an additional pass of decontamination is performed using approximate nearest neighbor search (via faiss).\n\n### Total dataset size\n\nThe deduplicated and decontamined list of instructions contains 1,671,822 items:\n\n- 1,602,217 SFT/instructions\n- 59,247 DPO pairs\n- 1606 with both SFT and DPO data\n\nKeep in mind, this number becomes 4x larger when applying the various prompt formats.\n\n## Prompt formatting\n\nIn sticking with the theme of the bagel, I didn't want to use a single prompt format, so I used 4 - vicuna, llama-2, alpaca, and chat-ml (sorta).\nI also didn't want to randomly select a single prompt format for each item (hoping each instruction would generalize more when used in a variety of prompt formats), so each instruction is actually converted into every prompt format.\n\nThis means each epoch of our fine-tune is really basically 4 epochs.  So, for the fine-tunes, I would recommend only doing 1 epoch (or 0.75 epochs).  I am testing with a single epoch using a relatively low learning rate.\n\n### Alpaca (sort of)\n\n```\nBelow is an instruction that describes a task.  Write a response that appropriately completes the request.\n\n### Instruction:\n{system prompt, if provided}\n{instruction}\n\n### Response:\n```\n\nThe main difference here is that because of the dataset formatting and variety of data sources, it would have been much to tedious to add an `### Input:` block, so the inputs are just in the instruction section.\n\n### Vicuna\n\n```\n{system prompt, if provided, randomly defaulting to \"A chat between a user and an unbiased, uncensored assistant.\"}\nUSER: {instruction}\nASSISTANT:\n```\n\n### ChatML (sort of)\n\nI don't really understand the point of having special tokens for `<|im_start|>` and `<|im_end|>`, because in practice they just act as BOS and EOS tokens (but, please correct me if I'm wrong).\n\nSo, instead of:\n```text\n{bos}<|im_start|>{role}\n{text}\n<|im_end|>{eos}\n```\n\nI just changed it to:\n```text\n{bos}{role}\n{text}\n{eos}\n```\n\nIn practice, this would mean tokenization code like such:\n```python\ntokenizer = AutoTokenizer.from_pretrained('mistralai/mistral-7b-v0.1')\n\ninput_str = f\"\"\"system\nYou are a goat.\n{tokenizer.eos_token}\n{tokenizer.bos_token}user\nTell me how to fry an egg.\n{tokenizer.eos_token}\n{tokenizer.bos_token}assistant\n\"\"\"\n\ninputs = tokenizer(input_str, return_tensors=\"pt\")\n```\n\nIf you *really* want to use `<|im_start|>` and `<|im_end|>`, just update your `tokenizer_config.json` to use `<|im_start|>` instead of `<s>` and `<|im_end|>` instead of `</s>` and when tokenizing.  And if you still don't like what I've done to this chat-ml-ish format, feel free to cry into your pillow or fork the code and do a new fine-tune.\n\n### Llama-2 chat\n\n```\n[INST] <<SYS>>\n{system}\n<</SYS>>\n\n{instruction} [/INST]\n```\n\n## Fine tuning\n\n### SFT phase\n\nAn example for mistral-7b:\n\n*Note: I actually used my fork of [qlora](https://github.com/jondurbin/qlora)'s `train.py` for this, but I'm porting it to a minified version here, not tested yet!*\n\n*More notes: I stopped the SFT phase around 50% because of budget constraints.*\n\n```bash\nexport BASE_DIR=/workspace\nexport WANDB_API_KEY=[redacted]\nexport WANDB_PROJECT=bagel-7b-v0.1\n\n# Run the pretraining.\naccelerate launch bagel/tune/sft.py \\\n  --model_name_or_path $BASE_DIR/mistral-7b \\\n  --final_output_dir $BASE_DIR/$WANDB_PROJECT \\\n  --output_dir $BASE_DIR/$WANDB_PROJECT-workdir \\\n  --num_train_epochs 1 \\\n  --logging_steps 1 \\\n  --save_strategy steps \\\n  --save_steps 200 \\\n  --save_total_limit 5 \\\n  --data_seed 42 \\\n  --evaluation_strategy steps \\\n  --eval_dataset_size 0.0006 \\\n  --eval_steps 200 \\\n  --max_new_tokens 4096 \\\n  --dataloader_num_workers 3 \\\n  --logging_strategy steps \\\n  --remove_unused_columns False \\\n  --do_train \\\n  --full_finetune \\\n  --bf16 \\\n  --bits 16 \\\n  --optim adamw_torch \\\n  --lr_scheduler_type linear \\\n  --dataset $BASE_DIR/bagel/bagel-input-output-v0.1.parquet \\\n  --dataset_format input-output \\\n  --model_max_len 4096 \\\n  --per_device_train_batch_size 8 \\\n  --learning_rate 3.5e-7 \\\n  --warmup_ratio 0.005 \\\n  --adam_beta2 0.999 \\\n  --max_grad_norm 0.3 \\\n  --weight_decay 0.001 \\\n  --seed 42 \\\n  --report_to wandb \\\n  --gradient_checkpointing True \\\n  --gradient_accumulation_steps 4 \\\n  --skip_excess_length False \\\n  --ddp_find_unused_parameters False \\\n  --use_flash_attention_2 \\\n  --deepspeed deepspeed.json\n```\n\nDeepspeed configuration:\n```json\n{\n  \"gradient_accumulation_steps\": \"auto\",\n  \"gradient_clipping\": \"auto\",\n  \"train_batch_size\": \"auto\",\n  \"train_micro_batch_size_per_gpu\": \"auto\",\n  \"bf16\": {\n    \"enabled\": true\n  },\n  \"zero_optimization\": {\n    \"stage\": 2,\n    \"contiguous_gradients\": true,\n    \"overlap_comm\": true,\n    \"reduce_scatter\": true,\n    \"reduce_bucket_size\": 5e8,\n    \"allgather_bucket_size\": 5e8\n  }\n}\n```\n\n### DPO phase\n\nAn example of the DPO phase for mistral-7b (requires first running the SFT):\n\n```bash\nexport BASE_DIR=/mnt/data\nexport WANDB_API_KEY=[redacted]\nexport WANDB_PROJECT=bagel-dpo-7b-v0.1\n\naccelerate launch bagel/tune/dpo.py \\\n  --model_name_or_path bagel-7b-v0.1 \\\n  --learning_rate 3e-7 \\\n  --per_device_train_batch_size 2 \\\n  --gradient_accumulation_steps 4 \\\n  --max_length 4096 \\\n  --max_prompt_length 1024 \\\n  --max_target_length 3092 \\\n  --num_train_epochs 3 \\\n  --report_to wandb \\\n  --gradient_checkpointing true \\\n  --use_flash_attention_2 true \\\n  --dataset $BASE_DIR/bagel/bagel-dpo-v0.1.parquet \\\n  --eval_steps 5 \\\n  --eval_dataset_size 0.03 \\\n  --workdir $BASE_DIR/$WANDB_PROJECT-workdir \\\n  --output_dir $BASE_DIR/$WANDB_PROJECT \\\n  --deepspeed deepspeed.json \\\n  --save_steps 25 \\\n  --save_total_limit 5\n```\n\n<!-- original-model-card end -->\n",
    "related_quantizations": []
  },
  "tags": [
    "transformers",
    "gguf",
    "mistral",
    "dataset:ai2_arc",
    "dataset:unalignment/spicy-3.1",
    "dataset:codeparrot/apps",
    "dataset:facebook/belebele",
    "dataset:boolq",
    "dataset:jondurbin/cinematika-v0.1",
    "dataset:drop",
    "dataset:lmsys/lmsys-chat-1m",
    "dataset:TIGER-Lab/MathInstruct",
    "dataset:cais/mmlu",
    "dataset:Muennighoff/natural-instructions",
    "dataset:openbookqa",
    "dataset:piqa",
    "dataset:Vezora/Tested-22k-Python-Alpaca",
    "dataset:cakiki/rosetta-code",
    "dataset:Open-Orca/SlimOrca",
    "dataset:spider",
    "dataset:squad_v2",
    "dataset:migtissera/Synthia-v1.3",
    "dataset:datasets/winogrande",
    "dataset:nvidia/HelpSteer",
    "dataset:Intel/orca_dpo_pairs",
    "dataset:unalignment/toxic-dpo-v0.1",
    "dataset:jondurbin/truthy-dpo-v0.1",
    "dataset:allenai/ultrafeedback_binarized_cleaned",
    "base_model:jondurbin/bagel-dpo-7b-v0.1",
    "base_model:quantized:jondurbin/bagel-dpo-7b-v0.1",
    "license:apache-2.0",
    "region:us",
    "conversational"
  ],
  "likes": 5,
  "downloads": 370,
  "gated": false,
  "private": false,
  "last_modified": "2023-12-13T19:03:08.000Z",
  "created_at": "2023-12-13T18:28:49.000Z",
  "pipeline_tag": "",
  "library_name": "transformers"
}
Source payload excerpt (from Hugging Face API)
{
  "_id": "6579f7e1a1ecf0c79c124208",
  "id": "TheBloke/bagel-dpo-7B-v0.1-GGUF",
  "modelId": "TheBloke/bagel-dpo-7B-v0.1-GGUF",
  "sha": "465cbdf3ea266741d7b17e4ec1cd1de3e6ed3f1b",
  "createdAt": "2023-12-13T18:28:49.000Z",
  "lastModified": "2023-12-13T19:03:08.000Z",
  "author": "TheBloke",
  "downloads": 370,
  "likes": 5,
  "gated": false,
  "private": false,
  "pipeline_tag": "",
  "library_name": "transformers",
  "siblings_count": 15
}