Instructions to use maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf 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 maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
Use Docker
docker model run hf.co/maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf with Ollama:
ollama run hf.co/maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf with Docker Model Runner:
docker model run hf.co/maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
- Lemonade
How to use maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull maddes8cht/h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf:Q4_K_M
Run and chat with the model
lemonade run user.h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-gguf-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Commit ·
1371cf2
0
Parent(s):
Super-squash branch 'main' using huggingface_hub
Browse files- .gitattributes +62 -0
- README.md +294 -0
- h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_0.gguf +3 -0
- h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_K_M.gguf +3 -0
- h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_K_M.gguf +3 -0
- h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q6_K.gguf +3 -0
- h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q8_0.gguf +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
ggml-h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- gpt
|
| 7 |
+
- llm
|
| 8 |
+
- large language model
|
| 9 |
+
- h2o-llmstudio
|
| 10 |
+
inference: false
|
| 11 |
+
thumbnail: >-
|
| 12 |
+
https://h2o.ai/etc.clientlibs/h2o/clientlibs/clientlib-site/resources/images/favicon.ico
|
| 13 |
+
license: apache-2.0
|
| 14 |
+
datasets:
|
| 15 |
+
- OpenAssistant/oasst1
|
| 16 |
+
---
|
| 17 |
+
[]()
|
| 18 |
+
|
| 19 |
+
I'm constantly enhancing these model descriptions to provide you with the most relevant and comprehensive information
|
| 20 |
+
|
| 21 |
+
# h2ogpt-gm-oasst1-en-2048-falcon-40b-v2 - GGUF
|
| 22 |
+
- Model creator: [h2oai](https://huggingface.co/h2oai)
|
| 23 |
+
- Original model: [h2ogpt-gm-oasst1-en-2048-falcon-40b-v2](https://huggingface.co/h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2)
|
| 24 |
+
|
| 25 |
+
# K-Quants in Falcon 7b models
|
| 26 |
+
|
| 27 |
+
New releases of Llama.cpp now support K-quantization for previously incompatible models, in particular all Falcon 7B models (While Falcon 40b is and always has been fully compatible with K-Quantisation). This is achieved by employing a fallback solution for model layers that cannot be quantized with real K-quants.
|
| 28 |
+
|
| 29 |
+
For Falcon 7B models, although only a quarter of the layers can be quantized with true K-quants, this approach still benefits from utilizing *different* legacy quantization types Q4_0, Q4_1, Q5_0, and Q5_1. As a result, it offers better quality at the same file size or smaller file sizes with comparable performance.
|
| 30 |
+
|
| 31 |
+
So this solution ensures improved performance and efficiency over legacy Q4_0, Q4_1, Q5_0 and Q5_1 Quantizations.
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
# About GGUF format
|
| 38 |
+
|
| 39 |
+
`gguf` is the current file format used by the [`ggml`](https://github.com/ggerganov/ggml) library.
|
| 40 |
+
A growing list of Software is using it and can therefore use this model.
|
| 41 |
+
The core project making use of the ggml library is the [llama.cpp](https://github.com/ggerganov/llama.cpp) project by Georgi Gerganov
|
| 42 |
+
|
| 43 |
+
# Quantization variants
|
| 44 |
+
|
| 45 |
+
There is a bunch of quantized files available to cater to your specific needs. Here's how to choose the best option for you:
|
| 46 |
+
|
| 47 |
+
# Legacy quants
|
| 48 |
+
|
| 49 |
+
Q4_0, Q4_1, Q5_0, Q5_1 and Q8 are `legacy` quantization types.
|
| 50 |
+
Nevertheless, they are fully supported, as there are several circumstances that cause certain model not to be compatible with the modern K-quants.
|
| 51 |
+
## Note:
|
| 52 |
+
Now there's a new option to use K-quants even for previously 'incompatible' models, although this involves some fallback solution that makes them not *real* K-quants. More details can be found in affected model descriptions.
|
| 53 |
+
(This mainly refers to Falcon 7b and Starcoder models)
|
| 54 |
+
|
| 55 |
+
# K-quants
|
| 56 |
+
|
| 57 |
+
K-quants are designed with the idea that different levels of quantization in specific parts of the model can optimize performance, file size, and memory load.
|
| 58 |
+
So, if possible, use K-quants.
|
| 59 |
+
With a Q6_K, you'll likely find it challenging to discern a quality difference from the original model - ask your model two times the same question and you may encounter bigger quality differences.
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
# Original Model Card:
|
| 67 |
+
# Model Card
|
| 68 |
+
## Summary
|
| 69 |
+
|
| 70 |
+
This model was trained using [H2O LLM Studio](https://github.com/h2oai/h2o-llmstudio).
|
| 71 |
+
- Base model: [tiiuae/falcon-40b](https://huggingface.co/tiiuae/falcon-40b)
|
| 72 |
+
- Dataset preparation: [OpenAssistant/oasst1](https://github.com/h2oai/h2o-llmstudio/blob/1935d84d9caafed3ee686ad2733eb02d2abfce57/app_utils/utils.py#LL1896C5-L1896C28) personalized
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Usage
|
| 76 |
+
|
| 77 |
+
To use the model with the `transformers` library on a machine with GPUs, first make sure you have the `transformers`, `accelerate` and `torch` libraries installed.
|
| 78 |
+
|
| 79 |
+
```bash
|
| 80 |
+
pip install transformers==4.29.2
|
| 81 |
+
pip install bitsandbytes==0.39.0
|
| 82 |
+
pip install accelerate==0.19.0
|
| 83 |
+
pip install torch==2.0.0
|
| 84 |
+
pip install einops==0.6.1
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
```python
|
| 88 |
+
import torch
|
| 89 |
+
from transformers import pipeline, BitsAndBytesConfig, AutoTokenizer
|
| 90 |
+
|
| 91 |
+
model_kwargs = {}
|
| 92 |
+
|
| 93 |
+
quantization_config = None
|
| 94 |
+
# optional quantization
|
| 95 |
+
quantization_config = BitsAndBytesConfig(
|
| 96 |
+
load_in_8bit=True,
|
| 97 |
+
llm_int8_threshold=6.0,
|
| 98 |
+
)
|
| 99 |
+
model_kwargs["quantization_config"] = quantization_config
|
| 100 |
+
|
| 101 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 102 |
+
"h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2",
|
| 103 |
+
use_fast=False,
|
| 104 |
+
padding_side="left",
|
| 105 |
+
trust_remote_code=True,
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
generate_text = pipeline(
|
| 109 |
+
model="h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2",
|
| 110 |
+
tokenizer=tokenizer,
|
| 111 |
+
torch_dtype=torch.float16,
|
| 112 |
+
trust_remote_code=True,
|
| 113 |
+
use_fast=False,
|
| 114 |
+
device_map={"": "cuda:0"},
|
| 115 |
+
model_kwargs=model_kwargs,
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
res = generate_text(
|
| 119 |
+
"Why is drinking water so healthy?",
|
| 120 |
+
min_new_tokens=2,
|
| 121 |
+
max_new_tokens=1024,
|
| 122 |
+
do_sample=False,
|
| 123 |
+
num_beams=1,
|
| 124 |
+
temperature=float(0.3),
|
| 125 |
+
repetition_penalty=float(1.2),
|
| 126 |
+
renormalize_logits=True
|
| 127 |
+
)
|
| 128 |
+
print(res[0]["generated_text"])
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
You can print a sample prompt after the preprocessing step to see how it is feed to the tokenizer:
|
| 132 |
+
|
| 133 |
+
```python
|
| 134 |
+
print(generate_text.preprocess("Why is drinking water so healthy?")["prompt_text"])
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
```bash
|
| 138 |
+
<|prompt|>Why is drinking water so healthy?<|endoftext|><|answer|>
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
Alternatively, you can download [h2oai_pipeline.py](h2oai_pipeline.py), store it alongside your notebook, and construct the pipeline yourself from the loaded model and tokenizer:
|
| 142 |
+
|
| 143 |
+
```python
|
| 144 |
+
import torch
|
| 145 |
+
from h2oai_pipeline import H2OTextGenerationPipeline
|
| 146 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 147 |
+
|
| 148 |
+
quantization_config = None
|
| 149 |
+
# optional quantization
|
| 150 |
+
quantization_config = BitsAndBytesConfig(
|
| 151 |
+
load_in_8bit=True,
|
| 152 |
+
llm_int8_threshold=6.0,
|
| 153 |
+
)
|
| 154 |
+
|
| 155 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 156 |
+
"h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2",
|
| 157 |
+
use_fast=False,
|
| 158 |
+
padding_side="left",
|
| 159 |
+
trust_remote_code=True,
|
| 160 |
+
)
|
| 161 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 162 |
+
"h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2",
|
| 163 |
+
trust_remote_code=True,
|
| 164 |
+
torch_dtype=torch.float16,
|
| 165 |
+
device_map={"": "cuda:0"},
|
| 166 |
+
quantization_config=quantization_config
|
| 167 |
+
).eval()
|
| 168 |
+
generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
|
| 169 |
+
|
| 170 |
+
res = generate_text(
|
| 171 |
+
"Why is drinking water so healthy?",
|
| 172 |
+
min_new_tokens=2,
|
| 173 |
+
max_new_tokens=1024,
|
| 174 |
+
do_sample=False,
|
| 175 |
+
num_beams=1,
|
| 176 |
+
temperature=float(0.3),
|
| 177 |
+
repetition_penalty=float(1.2),
|
| 178 |
+
renormalize_logits=True
|
| 179 |
+
)
|
| 180 |
+
print(res[0]["generated_text"])
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
You may also construct the pipeline from the loaded model and tokenizer yourself and consider the preprocessing steps:
|
| 185 |
+
|
| 186 |
+
```python
|
| 187 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 188 |
+
|
| 189 |
+
# Important: The prompt needs to be in the same format the model was trained with.
|
| 190 |
+
# You can find an example prompt in the experiment logs.
|
| 191 |
+
prompt = "<|prompt|>How are you?<|endoftext|><|answer|>"
|
| 192 |
+
|
| 193 |
+
quantization_config = None
|
| 194 |
+
# optional quantization
|
| 195 |
+
quantization_config = BitsAndBytesConfig(
|
| 196 |
+
load_in_8bit=True,
|
| 197 |
+
llm_int8_threshold=6.0,
|
| 198 |
+
)
|
| 199 |
+
|
| 200 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 201 |
+
"h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2",
|
| 202 |
+
use_fast=False,
|
| 203 |
+
padding_side="left",
|
| 204 |
+
trust_remote_code=True,
|
| 205 |
+
)
|
| 206 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 207 |
+
"h2oai/h2ogpt-gm-oasst1-en-2048-falcon-40b-v2",
|
| 208 |
+
trust_remote_code=True,
|
| 209 |
+
torch_dtype=torch.float16,
|
| 210 |
+
device_map={"": "cuda:0"},
|
| 211 |
+
quantization_config=quantization_config
|
| 212 |
+
).eval()
|
| 213 |
+
|
| 214 |
+
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
|
| 215 |
+
|
| 216 |
+
# generate configuration can be modified to your needs
|
| 217 |
+
tokens = model.generate(
|
| 218 |
+
**inputs,
|
| 219 |
+
min_new_tokens=2,
|
| 220 |
+
max_new_tokens=1024,
|
| 221 |
+
do_sample=False,
|
| 222 |
+
num_beams=1,
|
| 223 |
+
temperature=float(0.3),
|
| 224 |
+
repetition_penalty=float(1.2),
|
| 225 |
+
renormalize_logits=True
|
| 226 |
+
)[0]
|
| 227 |
+
|
| 228 |
+
tokens = tokens[inputs["input_ids"].shape[1]:]
|
| 229 |
+
answer = tokenizer.decode(tokens, skip_special_tokens=True)
|
| 230 |
+
print(answer)
|
| 231 |
+
```
|
| 232 |
+
|
| 233 |
+
## Model Architecture
|
| 234 |
+
|
| 235 |
+
```
|
| 236 |
+
RWForCausalLM(
|
| 237 |
+
(transformer): RWModel(
|
| 238 |
+
(word_embeddings): Embedding(65024, 8192)
|
| 239 |
+
(h): ModuleList(
|
| 240 |
+
(0-59): 60 x DecoderLayer(
|
| 241 |
+
(ln_attn): LayerNorm((8192,), eps=1e-05, elementwise_affine=True)
|
| 242 |
+
(ln_mlp): LayerNorm((8192,), eps=1e-05, elementwise_affine=True)
|
| 243 |
+
(self_attention): Attention(
|
| 244 |
+
(maybe_rotary): RotaryEmbedding()
|
| 245 |
+
(query_key_value): Linear(in_features=8192, out_features=9216, bias=False)
|
| 246 |
+
(dense): Linear(in_features=8192, out_features=8192, bias=False)
|
| 247 |
+
(attention_dropout): Dropout(p=0.0, inplace=False)
|
| 248 |
+
)
|
| 249 |
+
(mlp): MLP(
|
| 250 |
+
(dense_h_to_4h): Linear(in_features=8192, out_features=32768, bias=False)
|
| 251 |
+
(act): GELU(approximate='none')
|
| 252 |
+
(dense_4h_to_h): Linear(in_features=32768, out_features=8192, bias=False)
|
| 253 |
+
)
|
| 254 |
+
)
|
| 255 |
+
)
|
| 256 |
+
(ln_f): LayerNorm((8192,), eps=1e-05, elementwise_affine=True)
|
| 257 |
+
)
|
| 258 |
+
(lm_head): Linear(in_features=8192, out_features=65024, bias=False)
|
| 259 |
+
)
|
| 260 |
+
```
|
| 261 |
+
|
| 262 |
+
## Model Configuration
|
| 263 |
+
|
| 264 |
+
This model was trained using H2O LLM Studio and with the configuration in [cfg.yaml](cfg.yaml). Visit [H2O LLM Studio](https://github.com/h2oai/h2o-llmstudio) to learn how to train your own large language models.
|
| 265 |
+
|
| 266 |
+
## Disclaimer
|
| 267 |
+
|
| 268 |
+
Please read this disclaimer carefully before using the large language model provided in this repository. Your use of the model signifies your agreement to the following terms and conditions.
|
| 269 |
+
|
| 270 |
+
- Biases and Offensiveness: The large language model is trained on a diverse range of internet text data, which may contain biased, racist, offensive, or otherwise inappropriate content. By using this model, you acknowledge and accept that the generated content may sometimes exhibit biases or produce content that is offensive or inappropriate. The developers of this repository do not endorse, support, or promote any such content or viewpoints.
|
| 271 |
+
- Limitations: The large language model is an AI-based tool and not a human. It may produce incorrect, nonsensical, or irrelevant responses. It is the user's responsibility to critically evaluate the generated content and use it at their discretion.
|
| 272 |
+
- Use at Your Own Risk: Users of this large language model must assume full responsibility for any consequences that may arise from their use of the tool. The developers and contributors of this repository shall not be held liable for any damages, losses, or harm resulting from the use or misuse of the provided model.
|
| 273 |
+
- Ethical Considerations: Users are encouraged to use the large language model responsibly and ethically. By using this model, you agree not to use it for purposes that promote hate speech, discrimination, harassment, or any form of illegal or harmful activities.
|
| 274 |
+
- Reporting Issues: If you encounter any biased, offensive, or otherwise inappropriate content generated by the large language model, please report it to the repository maintainers through the provided channels. Your feedback will help improve the model and mitigate potential issues.
|
| 275 |
+
- Changes to this Disclaimer: The developers of this repository reserve the right to modify or update this disclaimer at any time without prior notice. It is the user's responsibility to periodically review the disclaimer to stay informed about any changes.
|
| 276 |
+
|
| 277 |
+
By using the large language model provided in this repository, you agree to accept and comply with the terms and conditions outlined in this disclaimer. If you do not agree with any part of this disclaimer, you should refrain from using the model and any content generated by it.
|
| 278 |
+
|
| 279 |
+
***End of original Model File***
|
| 280 |
+
---
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
## Please consider to support my work
|
| 284 |
+
**Coming Soon:** I'm in the process of launching a sponsorship/crowdfunding campaign for my work. I'm evaluating Kickstarter, Patreon, or the new GitHub Sponsors platform, and I am hoping for some support and contribution to the continued availability of these kind of models. Your support will enable me to provide even more valuable resources and maintain the models you rely on. Your patience and ongoing support are greatly appreciated as I work to make this page an even more valuable resource for the community.
|
| 285 |
+
|
| 286 |
+
<center>
|
| 287 |
+
|
| 288 |
+
[](https://maddes8cht.github.io)
|
| 289 |
+
[](https://stackexchange.com/users/26485911)
|
| 290 |
+
[](https://github.com/maddes8cht)
|
| 291 |
+
[](https://huggingface.co/maddes8cht)
|
| 292 |
+
[](https://twitter.com/maddes1966)
|
| 293 |
+
|
| 294 |
+
</center>
|
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:292a766bdd437e7753180886297881be982e85b781d9609b6f83c9b19c073d32
|
| 3 |
+
size 23808462560
|
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ee004d62aa3a5cc5784f80f856dea736942e2cd41217d46a87cf9c464beb1a89
|
| 3 |
+
size 25452629728
|
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q5_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f217c527f23dd037db91e01d147ec681dcb5fe6af240f834b4df6c4669b04dd5
|
| 3 |
+
size 30642294496
|
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q6_K.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eab75c198ad754b9facf45b4ea9772660fbe425e05fce8c00e761c0ac0b7efe4
|
| 3 |
+
size 34456456928
|
h2oai-h2ogpt-gm-oasst1-en-2048-falcon-40b-v2-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6e5402c907bd63588e20867e7b51cafbe90bd3cfdc57552048505fc38b8e73b
|
| 3 |
+
size 44459118304
|