Spaces:
Sleeping
Sleeping
Upload 322 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +36 -0
- documentation/.gitignore +17 -0
- documentation/README.md +98 -0
- documentation/app_banner.png +0 -0
- documentation/docs/concepts.md +69 -0
- documentation/docs/faqs.md +181 -0
- documentation/docs/get-started/core-features.md +34 -0
- documentation/docs/get-started/llm-studio-flow.md +46 -0
- documentation/docs/get-started/llm-studio-home-screen.png +3 -0
- documentation/docs/get-started/llm-studio-performance.md +166 -0
- documentation/docs/get-started/set-up-llm-studio.md +328 -0
- documentation/docs/get-started/videos.md +49 -0
- documentation/docs/get-started/what-is-h2o-llm-studio.md +16 -0
- documentation/docs/guide/datasets/configure-dataset.png +3 -0
- documentation/docs/guide/datasets/data-connectors-format.md +35 -0
- documentation/docs/guide/datasets/import-dataset.md +222 -0
- documentation/docs/guide/datasets/import-h2o-drive-dataset.png +3 -0
- documentation/docs/guide/datasets/import-kaggle-dataset.png +3 -0
- documentation/docs/guide/datasets/import-s3-bucket.png +3 -0
- documentation/docs/guide/datasets/merge-datasets.md +34 -0
- documentation/docs/guide/datasets/merge-datasets.png +3 -0
- documentation/docs/guide/datasets/upload-dataset.png +3 -0
- documentation/docs/guide/datasets/upload-local-file.png +3 -0
- documentation/docs/guide/datasets/view-dataset.md +74 -0
- documentation/docs/guide/datasets/view-imported-dataset.png +3 -0
- documentation/docs/guide/experiments/best-validation-sample.png +3 -0
- documentation/docs/guide/experiments/charts-tab.png +3 -0
- documentation/docs/guide/experiments/chat-tab.png +3 -0
- documentation/docs/guide/experiments/compare-experiments.md +21 -0
- documentation/docs/guide/experiments/compare-experiments.png +3 -0
- documentation/docs/guide/experiments/create-an-experiment.md +68 -0
- documentation/docs/guide/experiments/delete-experiment.png +3 -0
- documentation/docs/guide/experiments/evaluate-model-using-llm.md +29 -0
- documentation/docs/guide/experiments/experiment-settings.md +468 -0
- documentation/docs/guide/experiments/export-model-to-huggingface.png +3 -0
- documentation/docs/guide/experiments/export-trained-model.md +61 -0
- documentation/docs/guide/experiments/import-to-h2ogpt.md +48 -0
- documentation/docs/guide/experiments/local-llm-judge-logs.png +3 -0
- documentation/docs/guide/experiments/run-experiment.png +3 -0
- documentation/docs/guide/experiments/set-endpoint.png +3 -0
- documentation/docs/guide/experiments/set-metric-model.png +3 -0
- documentation/docs/guide/experiments/stop-experiment.png +3 -0
- documentation/docs/guide/experiments/supported-problem-types.md +30 -0
- documentation/docs/guide/experiments/view-an-experiment.md +85 -0
- documentation/docs/guide/experiments/view-experiments.png +3 -0
- documentation/docs/guide/experiments/worst-validation-sample.png +3 -0
- documentation/docs/index.md +110 -0
- documentation/docs/key-terms.md +78 -0
- documentation/docs/tooltips/experiments/_add-eos-token-to-answer.mdx +1 -0
- documentation/docs/tooltips/experiments/_add-eos-token-to-prompt.mdx +1 -0
.gitattributes
CHANGED
@@ -33,3 +33,39 @@ saved_model/**/* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
documentation/docs/get-started/llm-studio-home-screen.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
documentation/docs/guide/datasets/configure-dataset.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
documentation/docs/guide/datasets/import-h2o-drive-dataset.png filter=lfs diff=lfs merge=lfs -text
|
39 |
+
documentation/docs/guide/datasets/import-kaggle-dataset.png filter=lfs diff=lfs merge=lfs -text
|
40 |
+
documentation/docs/guide/datasets/import-s3-bucket.png filter=lfs diff=lfs merge=lfs -text
|
41 |
+
documentation/docs/guide/datasets/merge-datasets.png filter=lfs diff=lfs merge=lfs -text
|
42 |
+
documentation/docs/guide/datasets/upload-dataset.png filter=lfs diff=lfs merge=lfs -text
|
43 |
+
documentation/docs/guide/datasets/upload-local-file.png filter=lfs diff=lfs merge=lfs -text
|
44 |
+
documentation/docs/guide/datasets/view-imported-dataset.png filter=lfs diff=lfs merge=lfs -text
|
45 |
+
documentation/docs/guide/experiments/best-validation-sample.png filter=lfs diff=lfs merge=lfs -text
|
46 |
+
documentation/docs/guide/experiments/charts-tab.png filter=lfs diff=lfs merge=lfs -text
|
47 |
+
documentation/docs/guide/experiments/chat-tab.png filter=lfs diff=lfs merge=lfs -text
|
48 |
+
documentation/docs/guide/experiments/compare-experiments.png filter=lfs diff=lfs merge=lfs -text
|
49 |
+
documentation/docs/guide/experiments/delete-experiment.png filter=lfs diff=lfs merge=lfs -text
|
50 |
+
documentation/docs/guide/experiments/export-model-to-huggingface.png filter=lfs diff=lfs merge=lfs -text
|
51 |
+
documentation/docs/guide/experiments/local-llm-judge-logs.png filter=lfs diff=lfs merge=lfs -text
|
52 |
+
documentation/docs/guide/experiments/run-experiment.png filter=lfs diff=lfs merge=lfs -text
|
53 |
+
documentation/docs/guide/experiments/set-endpoint.png filter=lfs diff=lfs merge=lfs -text
|
54 |
+
documentation/docs/guide/experiments/set-metric-model.png filter=lfs diff=lfs merge=lfs -text
|
55 |
+
documentation/docs/guide/experiments/stop-experiment.png filter=lfs diff=lfs merge=lfs -text
|
56 |
+
documentation/docs/guide/experiments/view-experiments.png filter=lfs diff=lfs merge=lfs -text
|
57 |
+
documentation/docs/guide/experiments/worst-validation-sample.png filter=lfs diff=lfs merge=lfs -text
|
58 |
+
documentation/docs/tutorials/tutorial-1a/configure-dataset.png filter=lfs diff=lfs merge=lfs -text
|
59 |
+
documentation/docs/tutorials/tutorial-1a/evaluate-experiment.png filter=lfs diff=lfs merge=lfs -text
|
60 |
+
documentation/docs/tutorials/tutorial-1a/import-dataset.png filter=lfs diff=lfs merge=lfs -text
|
61 |
+
documentation/docs/tutorials/tutorial-2a/configure-dataset.png filter=lfs diff=lfs merge=lfs -text
|
62 |
+
documentation/docs/tutorials/tutorial-2a/evaluate-experiment.png filter=lfs diff=lfs merge=lfs -text
|
63 |
+
documentation/docs/tutorials/tutorial-2a/import-dataset.png filter=lfs diff=lfs merge=lfs -text
|
64 |
+
static/screenshot-1.png filter=lfs diff=lfs merge=lfs -text
|
65 |
+
static/screenshot-2.png filter=lfs diff=lfs merge=lfs -text
|
66 |
+
static/screenshot-3.png filter=lfs diff=lfs merge=lfs -text
|
67 |
+
static/screenshot-4.png filter=lfs diff=lfs merge=lfs -text
|
68 |
+
static/screenshot-5.png filter=lfs diff=lfs merge=lfs -text
|
69 |
+
static/screenshot-6.png filter=lfs diff=lfs merge=lfs -text
|
70 |
+
static/screenshot-7.png filter=lfs diff=lfs merge=lfs -text
|
71 |
+
static/screenshot-9.png filter=lfs diff=lfs merge=lfs -text
|
documentation/.gitignore
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
node_modules
|
2 |
+
tmp
|
3 |
+
|
4 |
+
# Generated files
|
5 |
+
.docusaurus
|
6 |
+
.cach-loader
|
7 |
+
|
8 |
+
# Misc
|
9 |
+
.DS_Store
|
10 |
+
.env.local
|
11 |
+
.env.development.local
|
12 |
+
.env.test.local
|
13 |
+
.env.production.local
|
14 |
+
|
15 |
+
npm-debug.log*
|
16 |
+
yarn-debug.log*
|
17 |
+
yarn-error.log*
|
documentation/README.md
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# H2O LLM Studio Documentation
|
2 |
+
|
3 |
+
- The LLM Studio documentation is built using [Makersaurus](https://github.com/h2oai/makersaurus/pkgs/npm/makersaurus) which is a very thin wrapper around Facebook's Docusaurus.
|
4 |
+
- The documentation is displayed at {{ https://docs.h2o.ai/h2o-llm-studio/ }}
|
5 |
+
|
6 |
+
To view, edit, and cut a version of the documentation, the following is required:
|
7 |
+
|
8 |
+
- Node.js version 16.14+ (you can check your version by running `node -v`). Use nvm to manage multiple Node versions installed on a single machine.
|
9 |
+
|
10 |
+
- To install Node.js and npm with nvm in Mac or Ubuntu, run: `curl -o-
|
11 |
+
https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash` and `nvm install node`
|
12 |
+
|
13 |
+
- Makersaurus (the H2O themed documentation site) is hosted on H2O's Github npm registry. npm must authenticate to the registry before you can download Makersaurus. Follow the 3 steps below to authenticate the npm package.
|
14 |
+
|
15 |
+
If you have already installed `@h2oai/ui-kit` or any other private `@h2oai`-prefixed npm package you can skip this step.
|
16 |
+
|
17 |
+
**Step 1:** Create a "classic" [personal access token](https://github.com/settings/tokens) (PAT) on Github. Note that you only need to enable the `read:packages` scope for this token.
|
18 |
+
|
19 |
+
**Step 2:** Add the PAT to your `~/.npmrc` file. Create this file if it doesn't exist yet.
|
20 |
+
```
|
21 |
+
@h2oai:registry=https://npm.pkg.github.com/
|
22 |
+
//npm.pkg.github.com/:_authToken=YOUR-GENERATED-TOKEN
|
23 |
+
```
|
24 |
+
**Step 3:** Verify that it worked by running the following command:
|
25 |
+
```
|
26 |
+
npm whoami --registry=https://npm.pkg.github.com
|
27 |
+
```
|
28 |
+
If this command returns your username, you can proceed to the next step. If you get an error, you are not yet authenticated. You might find the [Github registry docs](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token) helpful for debugging.
|
29 |
+
|
30 |
+
### Documentation structure
|
31 |
+
|
32 |
+
|
33 |
+
```
|
34 |
+
├── documentation
|
35 |
+
│ ├── docs
|
36 |
+
│ ├── tmp
|
37 |
+
│ ├── makersaurus.config.js
|
38 |
+
│ ├── sidebars.js
|
39 |
+
│ ├── package.json
|
40 |
+
│ ├── package-lock.json
|
41 |
+
```
|
42 |
+
|
43 |
+
- `documentation/docs`: Contains Markdown documentation files to edit the next documentation version.
|
44 |
+
Customize the order of the docs sidebar in `sidebars.js`
|
45 |
+
- `documentation/tmp`: Temporary files generated by Makersaurus. Do not edit these files.
|
46 |
+
- `documentation/makersaurus.config.js`: Makersaurus [config file](https://h2oai.github.io/makersaurus/api/config)
|
47 |
+
- `documentation/sidebars.js`: Sidebar configuration file
|
48 |
+
- `documentation/package.json`: npm configuration file
|
49 |
+
- `documentation/package-lock.json`: Generated by npm. Do not edit this file.
|
50 |
+
|
51 |
+
|
52 |
+
### Edit locally
|
53 |
+
|
54 |
+
To setup the local `env` to view and edit the next or past documentation versions ([first, ensure you install
|
55 |
+
Node.js](#requirements)):
|
56 |
+
|
57 |
+
1. Enter the documentation folder
|
58 |
+
|
59 |
+
`cd documentation`
|
60 |
+
|
61 |
+
2. Install dependencies
|
62 |
+
|
63 |
+
`npm install`
|
64 |
+
|
65 |
+
3. Start Makersaurus
|
66 |
+
|
67 |
+
`npm start`
|
68 |
+
|
69 |
+
- **Next documentation version**: To view your edits for the next documentation version, navigate to the provided URL.
|
70 |
+
Then, select **Next** on the **Versions** dropdown menu.
|
71 |
+
- **Debug**
|
72 |
+
- If you don't see anything after clicking **Next**, run the following command and try again:
|
73 |
+
`make setup-doc`
|
74 |
+
- Ensure that the following variable is set to `true` in the `makersaurus.config.js` file (located at `docs`):
|
75 |
+
`includeCurrentVersion`
|
76 |
+
- **Past documentation versions**: To view your edits for past documentation versions (located at
|
77 |
+
`docs/versioned_docs/`), navigate to the provided URL (for example, `http://localhost:3000/h2o-llm-studio/`).
|
78 |
+
Then, select a *version* (for example, v0.2.0) on the **Versions** dropdown menu.
|
79 |
+
|
80 |
+
### Cut a version
|
81 |
+
|
82 |
+
To cut a new version after making specific changes at `documentation/docs` to align with the next version of the application, consider the following instructions:
|
83 |
+
|
84 |
+
1. Before a new version of the documentation is released, and right before we cut a version (`make version-doc`), change the following variable located in the `makersaurus.config.js` file to `false`: `includeCurrentVersion`
|
85 |
+
2. Run: `make version-doc` (for example, `make version-doc DOC_VERSION=v0.3.0`)
|
86 |
+
3. After the previous steps are executed and all generated files are pushed to the main branch, trigger the following
|
87 |
+
script in GitHub actions: `deploy-to-github-pages.yml`
|
88 |
+
4. After publishing the new documentation version, change the following variable located in the
|
89 |
+
`makersaurus.config.js` file to `true`: `includeCurrentVersion`
|
90 |
+
- This ensures the next doc version to edit will be visible while editing locally
|
91 |
+
|
92 |
+
|
93 |
+
## More information
|
94 |
+
|
95 |
+
Use the [Makersaurus docs](https://h2oai.github.io/makersaurus/) to learn more about how to edit docs, deploy the site, set up versioning and more.
|
96 |
+
|
97 |
+
|
98 |
+
|
documentation/app_banner.png
ADDED
![]() |
documentation/docs/concepts.md
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Learn about concepts around H2O LLM Studio.
|
3 |
+
---
|
4 |
+
# Concepts
|
5 |
+
|
6 |
+
H2O LLM Studio is based on a few key concepts and uses several key terms across its documentation. Each, in turn, is explained within the sections below.
|
7 |
+
|
8 |
+
## LLM
|
9 |
+
|
10 |
+
A Large Language Model (LLM) is a type of AI model that uses deep learning techniques and uses massive datasets to analyze and generate human-like language. For example, many AI chatbots or AI search engines are powered by LLMs.
|
11 |
+
|
12 |
+
Generally speaking, LLMs can be characterized by the following parameters:
|
13 |
+
- size of the training dataset
|
14 |
+
- cost of training (computational power)
|
15 |
+
- size of the model (parameters)
|
16 |
+
- performance after training (or how well the model is able to respond to a particular question)
|
17 |
+
|
18 |
+
## Parameters and hyperparameters
|
19 |
+
|
20 |
+
In the context of an LLM, parameters and hyperparameters are a crucial part of determinining the model's performance and overall behaviour.
|
21 |
+
|
22 |
+
- **Parameters:** The internal variables of the model that are learned during the training process. In the case of an LLM, parameters typically include the weights and biases associated with the neural network layers. The values of parameters directly influence the model's predictions and the quality of generated text.
|
23 |
+
|
24 |
+
- **Hyperparameters:** The configuration choices that are set before training the model and are not learned directly from the data (e.g., number of epochs, batch size etc.). These choices impact the learning process and influence the model's overall behavior. Hyperparameters need to be tuned and optimized to achieve the best performance. H2O LLM Studio GUI shows tooltips next to each hyperparameter to explain what each hyperparameter is for. You can also see the following references for more details about hyperparameters in H2O LLM Studio.
|
25 |
+
- Dataset settings
|
26 |
+
- [Experiment settings](./guide/experiments/experiment-settings)
|
27 |
+
|
28 |
+
|
29 |
+
## LLM Backbone
|
30 |
+
|
31 |
+
LLM Backbone is a key hyperparamter that determines the model's architecture. This option is the most important setting when it comes to experiment creation, as it sets the pretrained model weights. For more information about LLM Backbone, see [Experiment settings](guide/experiments/experiment-settings.md#llm-backbone).
|
32 |
+
|
33 |
+
|
34 |
+
## Generative AI
|
35 |
+
|
36 |
+
Generative AI refers to AI models that can generate new content, such as images, videos, or text, that did not exist before. These models learn from large datasets and use this knowledge to create new content that is similar in style or content to the original dataset.
|
37 |
+
|
38 |
+
|
39 |
+
## Foundation model
|
40 |
+
|
41 |
+
A particular adaptive model that has been trained on a large amount of data and starts to derive relationships between words and concepts. Foundation models are fine-tuned to become more specific and adapt to the related domain more efficiently.
|
42 |
+
|
43 |
+
## Fine-tuning
|
44 |
+
|
45 |
+
Fine-tuning refers to the process of taking a pre-trained language model and further training it on a specific task or domain to improve its performance on that task. It is an important technique used to adapt LLMs to specific tasks and domains.
|
46 |
+
|
47 |
+
## LoRA (Low-Rank Adaptation)
|
48 |
+
|
49 |
+
Low-Rank Adapation (LoRa) involves modifying the pre-trained model by adjusting its weights and biases to better fit the new task. This adaptation is done in a way that preserves the pre-trained weights from the original dataset while also adjusting for the new task's specific requirements. This method of training or fine-turning models consumes less memory. By using low rank adaptation, the pre-trained model can be quickly adapted to new tasks, without requiring a large amount of new training data.
|
50 |
+
|
51 |
+
## Quantization
|
52 |
+
|
53 |
+
Quantization is a technique used to reduce the size and memory requirements of a large language model without sacrificing its accuracy. This is done by converting the floating-point numbers used to represent the model's parameters to lower-precision numbers, such as half-floats or bfloat16. Quantization can be used to make language models more accessible to users with limited computing resources.
|
54 |
+
|
55 |
+
## 8-bit model training with a low memory footprint
|
56 |
+
|
57 |
+
8-bit model training with a low memory footprint refers to a fine-tuning technique that reduces the memory requirements for training neural networks by using 8-bit integers instead of 32-bit floating-point numbers. This approach can significantly reduce the amount of memory needed to store the model's parameters and can make it possible to train larger models on hardware with limited memory capacity.
|
58 |
+
|
59 |
+
### BLEU
|
60 |
+
|
61 |
+
Bilingual Evaluation Understudy (BLEU) is a model evaluation metric that is used to measure the quality of the predicted text against the input text.
|
62 |
+
|
63 |
+
BLEU: BLEU (Bilingual Evaluation Understudy) measures the quality of machine-generated texts by comparing them to reference texts by calculating a score between 0 and 1, where a higher score indicates a better match with the reference text. BLEU is based on the concept of n-grams, which are contiguous sequences of words. The different variations of BLEU such as BLEU-1, BLEU-2, BLEU-3, and BLEU-4 differ in the size of the n-grams considered for evaluation. BLEU-n measures the precision of n-grams (n consecutive words) in the generated text compared to the reference text. It calculates the precision score by counting the number of overlapping n-grams and dividing it by the total number of n-grams in the generated text.
|
64 |
+
|
65 |
+
### Perplexity
|
66 |
+
|
67 |
+
Perplexity (PPL) is a commonly used evaluation metric. It measures the confidence a model has in its predictions, or in simpler words how 'perplexed' or surprised it is by seeing new data. Perplexity is defined as the exponentiated cross-entropy of a sequence of tokens. Lower perplexity means the model is highly confident and accurate in the sequence of tokens it is responding with.
|
68 |
+
|
69 |
+
|
documentation/docs/faqs.md
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Learn about frequently asked questions.
|
3 |
+
---
|
4 |
+
import Icon from "@material-ui/core/Icon";
|
5 |
+
|
6 |
+
# FAQs
|
7 |
+
|
8 |
+
The sections below provide answers to frequently asked questions. If you have additional questions, please send them to [[email protected]](mailto:[email protected]).
|
9 |
+
|
10 |
+
---
|
11 |
+
|
12 |
+
### What are the general recommendations for using H2O LLM Studio?
|
13 |
+
|
14 |
+
The recommendation is to always start with the default settings. From there, the parameters that tend to have the largest impact are:
|
15 |
+
- the LLM backbone
|
16 |
+
- the number of epochs
|
17 |
+
- the learning rate
|
18 |
+
- the LoRA settings
|
19 |
+
|
20 |
+
:::info
|
21 |
+
For more information on experiment settings, see [Experiment Settings](guide/experiments/experiment-settings).
|
22 |
+
:::
|
23 |
+
|
24 |
+
The parameters that have the largest impact on the amount of GPU memory being used are the [backbone dtype](guide/experiments/experiment-settings#backbone-dtype) and the [max length](guide/experiments/experiment-settings#max-length) (the length of the input sequence being used during model training).
|
25 |
+
|
26 |
+
:::info
|
27 |
+
For more information, see [this FAQ about GPU out-of-memory issues](#i-encounter-gpu-out-of-memory-issues-what-can-i-change-to-be-able-to-train-large-models).
|
28 |
+
:::
|
29 |
+
|
30 |
+
While these parameters will change the behavior of the fine-tuned model, the change that will be most impactful is the actual data used for fine tuning. Having clean data and enough samples (i.e., atleast 1000 records) is imperative.
|
31 |
+
|
32 |
+
---
|
33 |
+
|
34 |
+
### Is the tool multi-user or single user?
|
35 |
+
|
36 |
+
While it is possible for multiple users to use the same instance, the tool was created for a single user at a time.
|
37 |
+
|
38 |
+
----
|
39 |
+
|
40 |
+
### How can human feedback be applied in LLM Studio?
|
41 |
+
|
42 |
+
In order to apply human feedback to H2O LLM Studio, there is a problem type called DPO (Direct Preference Optimization), which is specifically used for learning human feedback. For these types of use cases, there would be a selected answer and a rejected answer column to train a reward model. This is a more stable form of the traditional RLHF. For more information, see [this paper about DPO](https://arxiv.org/abs/2305.18290) by Stanford University.
|
43 |
+
|
44 |
+
----
|
45 |
+
|
46 |
+
### How does H2O LLM Studio evaluate the fine-tuned model?
|
47 |
+
|
48 |
+
The valuation options are [BLEU](concepts#bleu), [Perplexity](concepts#perplexity), and an AI Judge. For more information about the traditional NLP similarity metrics, see [BLEU](concepts#bleu) and [Perplexity](concepts#perplexity) explained on the concepts page. You can also opt to use an AI judge by having an LLM model (ChatGPT or a local LLM) judge the performance of the response. This [sample prompt](https://github.com/h2oai/h2o-llmstudio/blob/main/prompts/general.txt) is an example of a prompt that is used to have the LLM evaluate the response.
|
49 |
+
|
50 |
+
----
|
51 |
+
|
52 |
+
### Can I use a different AI Judge than ChatGPT?
|
53 |
+
|
54 |
+
Yes. For instructions on how to use a local LLM to evaluate the fine-tuned model, see [Evaluate model using an AI judge](guide/experiments/evaluate-model-using-llm).
|
55 |
+
|
56 |
+
---
|
57 |
+
|
58 |
+
### How much data is generally required to fine-tune a model?
|
59 |
+
|
60 |
+
There is no clear answer. As a rule of thumb, 1000 to 50000 samples of conversational data should be enough. Quality and diversity is very important. Make sure to try training on a subsample of data using the "sample" parameter to see how big the impact of the dataset size is. Recent studies suggest that less data is needed for larger foundation models.
|
61 |
+
|
62 |
+
---
|
63 |
+
|
64 |
+
### Are there any recommendations for which backbone to use? Are some backbones better for certain types of tasks?
|
65 |
+
|
66 |
+
The majority of the LLM backbones are trained on a very similar corpus of data. The main difference is the size of the model and the number of parameters. Usually, the larger the model, the better they are. The larger models also take longer to train. It is recommended to start with the smallest model and then increase the size if the performance is not satisfactory. If you are looking to train for tasks that are not directly question answering in English, it is also a good idea to look for specialized LLM backbones.
|
67 |
+
|
68 |
+
---
|
69 |
+
|
70 |
+
### What if my data is not in question-and-answer form and I just have documents? How can I fine-tune the LLM model?
|
71 |
+
|
72 |
+
To train a chatbot style model, you need to convert your data into a question and answer format.
|
73 |
+
|
74 |
+
If you really want to continue pretraining on your own data without teaching a question-answering style, prepare a dataset with all your data in a single column Dataframe. Make sure that the length of the text in each row is not too long. In the experiment setup, remove all additional tokens (e.g. `<|prompt|>`, `<|answer|>`, for Text Prompt Start and Text Answer Start respectively) and disable **Add Eos Token To Prompt** and **Add Eos Token To Answer**. Deselect everything in the Prompt Column.
|
75 |
+
|
76 |
+
There are also other enterprise solutions from H2O.ai that may help you convert your data into a Q&A format. For more information, see [H2O.ai's Generative AI page](https://h2o.ai/) and this blogpost about [H2O LLM DataStudio: Streamlining Data Curation and Data Preparation for LLMs related tasks](https://h2o.ai/blog/2023/streamlining-data-preparation-for-fine-tuning-of-large-language-models/).
|
77 |
+
|
78 |
+
---
|
79 |
+
|
80 |
+
|
81 |
+
### Can the adapter be downloaded after fine-tuning so that the adapter can be combined with the backbone LLM for deployment?
|
82 |
+
|
83 |
+
H2O LLM Studio provides the option to download only the LoRA adapter when a model was trained with LoRA. Once the experiment has finished running, click the **Download adapter** button to download the lora adapter_weights separately from a fine-tuned model.
|
84 |
+
|
85 |
+
---
|
86 |
+
|
87 |
+
### I encounter GPU out-of-memory issues. What can I change to be able to train large models?
|
88 |
+
|
89 |
+
There are various parameters that can be tuned while keeping a specific LLM backbone fixed. It is advised to choose 4bit/8bit precision as a backbone dtype to be able to train models >=7B on a consumer type GPU. [LORA](concepts#lora-low-rank-adaptation) should be enabled. Besides that there are the usual parameters such as batch size and maximum sequence length that can be decreased to save GPU memory (please ensure that your prompt+answer text is not truncated too much by checking the train data insights).
|
90 |
+
|
91 |
+
---
|
92 |
+
|
93 |
+
### When does the model stop the fine-tuning process?
|
94 |
+
|
95 |
+
The number of epochs are set by the user.
|
96 |
+
|
97 |
+
---
|
98 |
+
|
99 |
+
### What is the maximum dataset size that an LLM Studio instance can handle?
|
100 |
+
|
101 |
+
The total dataset size is basically unlimited / only bound by disk space as all training is done in batches. There is no specific rule of thumb for maximum batch size - this depends strongly on backbone, context size, use of flash attention 2.0, use of gradient checkpointing, etc.
|
102 |
+
We suggest using a batch size that just fills the RAM for maximum efficiency. While testing for maximum memory consumption, set padding quantile to `0`. Make sure to set it back to `1` when you have found a good setting for the batch size to save on runtime.
|
103 |
+
|
104 |
+
----
|
105 |
+
|
106 |
+
### Where does H2O LLM Studio store its data?
|
107 |
+
|
108 |
+
By default, H2O LLM Studio stores its data in two folders located in the root directory in the app. The folders are named `data` and `output`. Here is the breakdown of the data storage structure:
|
109 |
+
- `data/dbs`: This folder contains the user database used within the app.
|
110 |
+
- `data/user`: This folder is where uploaded datasets from the user are stored.
|
111 |
+
- `output/user`: All experiments conducted in H2O LLM Studio are stored in this folder. For each experiment, a separate folder is created within the `output/user` directory, which contains all the relevant data associated with that particular experiment.
|
112 |
+
- `output/download`: Utility folder that is used to store data the user downloads within the app.
|
113 |
+
|
114 |
+
It is possible to change the default working directory of H2O LLM Studio by setting the `H2O_LLM_STUDIO_WORKDIR` environment variable. By default, the working directory is set to the root directory of the app.
|
115 |
+
|
116 |
+
----
|
117 |
+
|
118 |
+
### How can I update H2O LLM Studio?
|
119 |
+
|
120 |
+
To update H2O LLM Studio, you have two options:
|
121 |
+
|
122 |
+
1. Using the latest main branch: Execute the commands `git checkout main` and `git pull` to obtain the latest updates from the main branch.
|
123 |
+
2. Using the latest release tag: Execute the commands `git pull` and `git checkout v0.0.3` (replace 'v0.0.3' with the desired version number) to switch to the latest release branch.
|
124 |
+
|
125 |
+
The update process does not remove or erase any existing data folders or experiment records. This means that all your old data, including the user database, uploaded datasets, and experiment results, will still be available to you within the updated version of H2O LLM Studio.
|
126 |
+
|
127 |
+
Before updating, it is recommended to run the `git rev-parse --short HEAD` command and save the commit hash.
|
128 |
+
This will allow you to revert to your existing version if needed.
|
129 |
+
|
130 |
+
---
|
131 |
+
|
132 |
+
### Once I have the [LoRA](guide/experiments/experiment-settings.md#lora), what is the recommended way of utilizing it with the base model?
|
133 |
+
|
134 |
+
You can also export the LoRA weights. You may add them to the files to be exported [here](https://github.com/h2oai/h2o-llmstudio/blob/main/llm_studio/app_utils/sections/experiment.py#L1552). Before exporting, the LoRA weights are merged back into the original LLM backbone weights to make downstream tasks easier. You do not need to have PEFT, or anything else for your deployment.
|
135 |
+
|
136 |
+
---
|
137 |
+
|
138 |
+
### How to use H2O LLM Studio in Windows?
|
139 |
+
|
140 |
+
Use WSL 2 on Windows
|
141 |
+
|
142 |
+
---
|
143 |
+
|
144 |
+
### How can I easily fine-tune a large language model (LLM) using the command-line interface (CLI) of H2O LLM Studio when I have limited GPU memory?
|
145 |
+
|
146 |
+
If you have limited GPU memory but still want to fine-tune a large language model using H2O LLM Studio's CLI, there are alternative methods you can use to get started quickly.
|
147 |
+
|
148 |
+
- [Using Kaggle kernels](https://www.kaggle.com/code/ilu000/h2o-llm-studio-cli/)
|
149 |
+
- [Using Google Colab](https://colab.research.google.com/drive/1soqfJjwDJwjjH-VzZYO_pUeLx5xY4N1K?usp=sharing)
|
150 |
+
|
151 |
+
---
|
152 |
+
|
153 |
+
### Can I run a validation metric on a model post-training, optionally on a different validation dataset?
|
154 |
+
|
155 |
+
Yes.
|
156 |
+
|
157 |
+
1. After you have finished creating an experiment, click on the <Icon>more_vert</Icon> Kebab menu of the relevant experiment and select **New Experiment**.
|
158 |
+
|
159 |
+
2. Enable the **Use previous experiments weight** setting found at the top of the screen.
|
160 |
+
This will now load the previous weights, and you can now change eval dataset, metric, and anything else as you see fit. To only do evaluation without any retraining, set the **Epochs** to 0.
|
161 |
+
|
162 |
+
----
|
163 |
+
|
164 |
+
### What are the hardware/infrastructure sizing recommendations for H2O LLM Studio?
|
165 |
+
|
166 |
+
When it comes to hardware requirements, it is important to note that the primary demand centers around the GPU and its associated VRAM. In terms of CPUs, most modern choices should suffice as NLP tasks typically do not heavily stress CPU performance. As for RAM, it's advisable to have a minimum of 128GB, with a stronger recommendation of 256GB or more, particularly when dealing with substantial model weights that must be accommodated in the CPU RAM.
|
167 |
+
|
168 |
+
----
|
169 |
+
|
170 |
+
### I am seeing an OS error during the H2O LLM Studio training session. What should I do?
|
171 |
+
|
172 |
+
If you recieve the following error, it is most likely because of network issues either with your own connection or on the Hugging Face Hub side.
|
173 |
+
|
174 |
+
```title="Error"
|
175 |
+
OSError: Consistency check failed: file should be of size 4999819336 but has size
|
176 |
+
14099570832 ((…)ve/main/ model-00002-of-00003.safetensors).
|
177 |
+
```
|
178 |
+
|
179 |
+
In most cases, rerunning the experiment will solve it as the download of the model weights will be re-initiated.
|
180 |
+
|
181 |
+
---
|
documentation/docs/get-started/core-features.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Learn about the core features of LLM Studio.
|
3 |
+
---
|
4 |
+
# Core features
|
5 |
+
|
6 |
+
## No-code fine-tuning
|
7 |
+
|
8 |
+
NLP practitioners can easily fine-tune models without the need for code expertise. The user interface, which is specifically designed for LLMs, allows users to upload large datasets easily and configure [hyperparameters](../concepts#parameters-and-hyperparameters) to fine-tune the model.
|
9 |
+
|
10 |
+
## Highly customizable (wide range of hyperparameters)
|
11 |
+
|
12 |
+
H2O LLM Studio supports a wide variety of hyperparameters that can be used to fine-tune the model and supports the following fine-tuning techniques to enable advanced customization:
|
13 |
+
|
14 |
+
- [Low-Rank Adaptation (LoRA)](../concepts#lora-low-rank-adaptation)
|
15 |
+
- [8-bit model training with a low memory footprint](../concepts#8-bit-model-training-with-a-low-memory-footprint)
|
16 |
+
|
17 |
+
## Advanced evaluation metrics and experiment comparison
|
18 |
+
|
19 |
+
Advanced evaluation metrics in H2O LLM Studio can be used to validate the answers generated by the LLM. This helps to make data-driven decisions about the model. It also offers visual tracking and comparison of experiment performance, making it easy to analyze and compare different fine-tuned models.You can also visualize how different parameters affect the model performance, and optionally use the [Neptune](https://neptune.ai/) or [W&B](https://wandb.ai/) integration to track and log your experiments.
|
20 |
+
|
21 |
+
## Instant publishing models
|
22 |
+
|
23 |
+
H2O LLM Studio enables easy model sharing with the community by allowing you to export the model to the [Hugging Face Hub](https://huggingface.co/h2oai) with a single click.
|
24 |
+
|
25 |
+
## Instant feedback on model performance
|
26 |
+
|
27 |
+
Additionally, H2O LLM Studio lets you chat with the fine-tuned model and receive instant feedback about model performance.
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
|
documentation/docs/get-started/llm-studio-flow.md
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: The flow of creating and fine-tuning large language models using H2O LLM Studio.
|
3 |
+
---
|
4 |
+
# Model flow
|
5 |
+
|
6 |
+
The flow of creating and fine-tuning large language models using H2O LLM Studio can be summarized in the following sequential steps:
|
7 |
+
|
8 |
+
- [Step 1: Import a dataset](#step-1-import-a-dataset)
|
9 |
+
- [Step 2: Create an experiment](#step-2-create-an-experiment)
|
10 |
+
- [Step 3: Monitor an experiment](#step-3-monitor-an-experiment)
|
11 |
+
- [Step 4: Compare experiments](#step-4-compare-experiments)
|
12 |
+
- [Step 5: Export a model to Hugging Face Hub](#step-5-export-a-model-to-hugging-face-hub)
|
13 |
+
|
14 |
+
## Step 1: Import a dataset
|
15 |
+
|
16 |
+
As the first step in the experiment flow, prep your data and import your dataset to H2O LLM Studio.
|
17 |
+
|
18 |
+
- To learn about supported data connectors and data format, see [Supported data connectors and format](../guide/datasets/data-connectors-format).
|
19 |
+
- To learn about how to import a dataset to H2O LLM Studio, see [Import a dataset](../guide/datasets/import-dataset).
|
20 |
+
- To learn about reviewing and editing a dataset, see [View and manage dataset](../guide/datasets/view-dataset.md).
|
21 |
+
|
22 |
+
## Step 2: Create an experiment
|
23 |
+
|
24 |
+
As the second step in the experiment flow, create an experiment using the imported dataset. H2O LLM Studio offers several hyperparameter settings that you can adjust for your experiment model. To ensure that your training process is effective, you may need to specify the [hyperparameters](../concepts#parameters-and-hyperparameters) like learning rate, batch size, and the number of epochs. H2O LLM Studio provides an overview of all the parameters you’ll need to specify for your experiment.
|
25 |
+
|
26 |
+
- To learn about creating a new experiment, see [Create an experiment](../guide/experiments/create-an-experiment.md).
|
27 |
+
- To learn about the settings available for creating an experiment, see [Experiment settings](../guide/experiments/experiment-settings.md).
|
28 |
+
|
29 |
+
## Step 3: Monitor an experiment
|
30 |
+
|
31 |
+
As the third step in the experiment flow, monitor the launched experiment. H2O LLM Studio allows you to inspect your experiment (model) during and after model training. Simple interactive graphs in H2O LLM Studio allow you to understand the impact of selected hyperparameter values during and after model training. You can then adjust the [hyperparameters](../concepts#parameters-and-hyperparameters) to further optimize model performance.
|
32 |
+
|
33 |
+
To learn about viewing and monitoring an experiment, see [View and manage experiments](../guide/experiments/view-an-experiment.md).
|
34 |
+
|
35 |
+
## Step 4: Compare experiments
|
36 |
+
|
37 |
+
The H2O LLM studio provides a useful feature that allows comparing various experiments and analyzing how different model parameters affect model performance. This feature is a powerful tool for fine-tuning your machine-learning models and ensuring they meet your desired performance metrics.
|
38 |
+
|
39 |
+
To learn about comparing multiple experiments, see [Compare experiments](../guide/experiments/compare-experiments.md).
|
40 |
+
|
41 |
+
## Step 5: Export a model to Hugging Face Hub
|
42 |
+
|
43 |
+
As the final step in the experiment flow, you can export the fine-tuned model to Hugging Face with a single click.
|
44 |
+
|
45 |
+
To learn about exporting a trained model to Hugging Face Hub, see, [Export trained model to Hugging Face](../guide/experiments/export-trained-model.md).
|
46 |
+
|
documentation/docs/get-started/llm-studio-home-screen.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/get-started/llm-studio-performance.md
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Setting up and running H2O LLM Studio requires the following minimal prerequisites. This page lists out the speed and performance metrics of H2O LLM Studio based on different hardware setups.
|
3 |
+
---
|
4 |
+
# H2O LLM Studio performance
|
5 |
+
|
6 |
+
Setting up and running H2O LLM Studio requires the following minimal [prerequisites](set-up-llm-studio.md#prerequisites). This page lists out the speed and performance metrics of H2O LLM Studio based on different hardware setups.
|
7 |
+
|
8 |
+
The following metrics were measured.
|
9 |
+
|
10 |
+
- **Hardware setup:** The type and number of computing devices used to train the model.
|
11 |
+
- **LLM backbone:** The underlying architecture of the language model. For more information, see [LLM backbone](concepts.md#llm-backbone).
|
12 |
+
- **Quantization:** A technique used to reduce the size and memory requirements of the model. For more information, see [Quantization](concepts.md#quantization).
|
13 |
+
- **Train**: The amount of time it took to train the model in hours and minutes.
|
14 |
+
- **Validation:** The amount of time it took to validate the mode in hours and minutes.
|
15 |
+
|
16 |
+
| Hardware setup | LLM backbone | Quantization | Train (hh:mm:ss)| Validation (hh:mm:ss) |
|
17 |
+
|---|---|---|---|---|
|
18 |
+
| 8xA10G | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 11:35 | 3:32 |
|
19 |
+
| 4xA10G | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 21:13 | 06:35 |
|
20 |
+
| 2xA10G | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 37:04 | 12:21 |
|
21 |
+
| 1xA10G | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 1:25:29 | 15:50 |
|
22 |
+
| 8xA10G | h2oai/h2ogpt-4096-llama2-7b | nf4 | 14:26 | 06:13 |
|
23 |
+
| 4xA10G | h2oai/h2ogpt-4096-llama2-7b | nf4 | 26:55 | 11:59 |
|
24 |
+
| 2xA10G | h2oai/h2ogpt-4096-llama2-7b | nf4 | 48:24 | 23:37 |
|
25 |
+
| 1xA10G | h2oai/h2ogpt-4096-llama2-7b | nf4 | 1:26:59 | 42:17 |
|
26 |
+
| 8xA10G | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | OOM | OOM |
|
27 |
+
| 4xA10G | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | OOM | OOM |
|
28 |
+
| 2xA10G | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | OOM | OOM |
|
29 |
+
| 1xA10G | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | OOM | OOM |
|
30 |
+
| 8xA10G | h2oai/h2ogpt-4096-llama2-13b | nf4 | 25:07 | 10:58 |
|
31 |
+
| 4xA10G | h2oai/h2ogpt-4096-llama2-13b | nf4 | 48:43 | 21:25 |
|
32 |
+
| 2xA10G | h2oai/h2ogpt-4096-llama2-13b | nf4 | 1:30:45 | 42:06 |
|
33 |
+
| 1xA10G | h2oai/h2ogpt-4096-llama2-13b | nf4 | 2:44:36 | 1:14:20 |
|
34 |
+
| 8xA10G | h2oai/h2ogpt-4096-llama2-70b | nf4 | OOM | OOM |
|
35 |
+
| 4xA10G | h2oai/h2ogpt-4096-llama2-70b | nf4 | OOM | OOM |
|
36 |
+
| 2xA10G | h2oai/h2ogpt-4096-llama2-70b | nf4 | OOM | OOM |
|
37 |
+
| 1xA10G | h2oai/h2ogpt-4096-llama2-70b | nf4 | OOM | OOM |
|
38 |
+
|---|---|---|---|---|
|
39 |
+
| 4xA100 80GB | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 7:04 | 3:55 |
|
40 |
+
| 2xA100 80GB | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 13:14 | 7:23 |
|
41 |
+
| 1xA100 80GB | h2oai/h2ogpt-4096-llama2-7b | bfloat16 | 23:36 | 13:25 |
|
42 |
+
| 4xA100 80GB | h2oai/h2ogpt-4096-llama2-7b | nf4 | 9:44 | 6:30 |
|
43 |
+
| 2xA100 80GB | h2oai/h2ogpt-4096-llama2-7b | nf4 | 18:34 | 12:16 |
|
44 |
+
| 1xA100 80GB | h2oai/h2ogpt-4096-llama2-7b | nf4 | 34:06 | 21:51 |
|
45 |
+
| 4xA100 80GB | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | 11:46 | 5:56 |
|
46 |
+
| 2xA100 80GB | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | 21:54 | 11:17 |
|
47 |
+
| 1xA100 80GB | h2oai/h2ogpt-4096-llama2-13b | bfloat16 | 39:10 | 18:55 |
|
48 |
+
| 4xA100 80GB | h2oai/h2ogpt-4096-llama2-13b | nf4 | 16:51 | 10:35 |
|
49 |
+
| 2xA100 80GB | h2oai/h2ogpt-4096-llama2-13b | nf4 | 32:05 | 21:00 |
|
50 |
+
| 1xA100 80GB | h2oai/h2ogpt-4096-llama2-13b | nf4 | 59:11 | 36:53 |
|
51 |
+
| 4xA100 80GB | h2oai/h2ogpt-4096-llama2-70b | nf4 | 1:13:33 | 46:02 |
|
52 |
+
| 2xA100 80GB | h2oai/h2ogpt-4096-llama2-70b | nf4 | 2:20:44 | 1:33:42 |
|
53 |
+
| 1xA100 80GB | h2oai/h2ogpt-4096-llama2-70b | nf4 | 4:23:57 | 2:44:51 |
|
54 |
+
|
55 |
+
:::info
|
56 |
+
The runtimes were gathered using the default parameters.
|
57 |
+
|
58 |
+
<details>
|
59 |
+
<summary>Expand to see the default parameters </summary>
|
60 |
+
|
61 |
+
```
|
62 |
+
architecture:
|
63 |
+
backbone_dtype: int4
|
64 |
+
gradient_checkpointing: true
|
65 |
+
intermediate_dropout: 0.0
|
66 |
+
pretrained: true
|
67 |
+
pretrained_weights: ''
|
68 |
+
augmentation:
|
69 |
+
random_parent_probability: 0.0
|
70 |
+
skip_parent_probability: 0.0
|
71 |
+
token_mask_probability: 0.0
|
72 |
+
dataset:
|
73 |
+
add_eos_token_to_answer: true
|
74 |
+
add_eos_token_to_prompt: true
|
75 |
+
add_eos_token_to_system: true
|
76 |
+
answer_column: output
|
77 |
+
chatbot_author: H2O.ai
|
78 |
+
chatbot_name: h2oGPT
|
79 |
+
data_sample: 1.0
|
80 |
+
data_sample_choice:
|
81 |
+
- Train
|
82 |
+
- Validation
|
83 |
+
limit_chained_samples: false
|
84 |
+
mask_prompt_labels: true
|
85 |
+
parent_id_column: None
|
86 |
+
personalize: false
|
87 |
+
prompt_column:
|
88 |
+
- instruction
|
89 |
+
system_column: None
|
90 |
+
text_answer_separator: <|answer|>
|
91 |
+
text_prompt_start: <|prompt|>
|
92 |
+
text_system_start: <|system|>
|
93 |
+
train_dataframe: /data/user/oasst/train_full.pq
|
94 |
+
validation_dataframe: None
|
95 |
+
validation_size: 0.01
|
96 |
+
validation_strategy: automatic
|
97 |
+
environment:
|
98 |
+
compile_model: false
|
99 |
+
find_unused_parameters: false
|
100 |
+
gpus:
|
101 |
+
- '0'
|
102 |
+
- '1'
|
103 |
+
- '2'
|
104 |
+
- '3'
|
105 |
+
- '4'
|
106 |
+
- '5'
|
107 |
+
- '6'
|
108 |
+
- '7'
|
109 |
+
huggingface_branch: main
|
110 |
+
mixed_precision: true
|
111 |
+
number_of_workers: 8
|
112 |
+
seed: -1
|
113 |
+
trust_remote_code: true
|
114 |
+
experiment_name: default-8-a10g
|
115 |
+
llm_backbone: h2oai/h2ogpt-4096-llama2-7b
|
116 |
+
logging:
|
117 |
+
logger: None
|
118 |
+
neptune_project: ''
|
119 |
+
output_directory: /output/...
|
120 |
+
prediction:
|
121 |
+
batch_size_inference: 0
|
122 |
+
do_sample: false
|
123 |
+
max_length_inference: 256
|
124 |
+
metric: BLEU
|
125 |
+
metric_gpt_model: gpt-3.5-turbo-0301
|
126 |
+
metric_gpt_template: general
|
127 |
+
min_length_inference: 2
|
128 |
+
num_beams: 1
|
129 |
+
num_history: 4
|
130 |
+
repetition_penalty: 1.2
|
131 |
+
stop_tokens: ''
|
132 |
+
temperature: 0.0
|
133 |
+
top_k: 0
|
134 |
+
top_p: 1.0
|
135 |
+
problem_type: text_causal_language_modeling
|
136 |
+
tokenizer:
|
137 |
+
add_prompt_answer_tokens: false
|
138 |
+
max_length: 512
|
139 |
+
padding_quantile: 1.0
|
140 |
+
training:
|
141 |
+
batch_size: 2
|
142 |
+
differential_learning_rate: 1.0e-05
|
143 |
+
differential_learning_rate_layers: []
|
144 |
+
drop_last_batch: true
|
145 |
+
epochs: 1
|
146 |
+
evaluate_before_training: false
|
147 |
+
evaluation_epochs: 1.0
|
148 |
+
grad_accumulation: 1
|
149 |
+
gradient_clip: 0.0
|
150 |
+
learning_rate: 0.0001
|
151 |
+
lora: true
|
152 |
+
use_dora: false
|
153 |
+
lora_alpha: 16
|
154 |
+
lora_dropout: 0.05
|
155 |
+
lora_r: 4
|
156 |
+
lora_target_modules: ''
|
157 |
+
loss_function: TokenAveragedCrossEntropy
|
158 |
+
optimizer: AdamW
|
159 |
+
save_checkpoint: "last"
|
160 |
+
schedule: Cosine
|
161 |
+
train_validation_data: false
|
162 |
+
warmup_epochs: 0.0
|
163 |
+
weight_decay: 0.0
|
164 |
+
```
|
165 |
+
</details>
|
166 |
+
:::
|
documentation/docs/get-started/set-up-llm-studio.md
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Learn how to set up LLM Studio.
|
3 |
+
---
|
4 |
+
import Tabs from "@theme/Tabs";
|
5 |
+
import TabItem from "@theme/TabItem";
|
6 |
+
|
7 |
+
# Set up H2O LLM Studio
|
8 |
+
|
9 |
+
This page guides you through setting up and installing H2O LLM Studio on your local system.
|
10 |
+
|
11 |
+
First, download the H2O LLM Studio package from the [H2O LLM Studio Github repository](https://github.com/h2oai/h2o-llmstudio). You can use `git clone` or navigate to the [releases page](https://github.com/h2oai/h2o-llmstudio/releases) and download the `.zip` file found within the **Assets** of the relevant release.
|
12 |
+
|
13 |
+
## Prerequisites
|
14 |
+
|
15 |
+
H2O LLM Studio requires the following minimum requirements:
|
16 |
+
|
17 |
+
- A machine with Ubuntu 16.04+ with atleast one recent Nvidia GPU
|
18 |
+
- Have at least 128GB+ of system RAM. Larger models and complex tasks may require 256GB+ or more.
|
19 |
+
- Nvidia drivers v470.57.02 or a later version
|
20 |
+
- Access to the following URLs:
|
21 |
+
- developer.download.nvidia.com
|
22 |
+
- pypi.org
|
23 |
+
- huggingface.co
|
24 |
+
- download.pytorch.org
|
25 |
+
- cdn-lfs.huggingface.co
|
26 |
+
|
27 |
+
:::info Notes
|
28 |
+
- Atleast 24GB of GPU memory is recommended for larger models.
|
29 |
+
- For more information on performance benchmarks based on the hardware setup, see [H2O LLM Studio performance](llm-studio-performance.md).
|
30 |
+
- The required URLs are accessible by default when you start a GCP instance, however, if you have network rules or custom firewalls in place, it is recommended to confirm that the URLs are accessible before running `make setup`.
|
31 |
+
:::
|
32 |
+
|
33 |
+
## Installation
|
34 |
+
|
35 |
+
:::note Installation methods
|
36 |
+
|
37 |
+
<Tabs className="unique-tabs">
|
38 |
+
<TabItem
|
39 |
+
value="recommended-install"
|
40 |
+
label="Linux/Ubuntu installation (recommended)"
|
41 |
+
default
|
42 |
+
>
|
43 |
+
<p>
|
44 |
+
The recommended way to install H2O LLM Studio is using pipenv with Python
|
45 |
+
3.10. To install Python 3.10 on Ubuntu 16.04+, execute the following
|
46 |
+
commands.
|
47 |
+
</p>
|
48 |
+
<p>
|
49 |
+
<b>System installs (Python 3.10)</b>
|
50 |
+
</p>
|
51 |
+
<pre>
|
52 |
+
<code>
|
53 |
+
sudo add-apt-repository ppa:deadsnakes/ppa <br></br>
|
54 |
+
sudo apt install python3.10 <br></br>
|
55 |
+
sudo apt-get install python3.10-distutils <br></br>
|
56 |
+
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
|
57 |
+
</code>
|
58 |
+
</pre>
|
59 |
+
<p>
|
60 |
+
<b>Install NVIDIA drivers (if required)</b>
|
61 |
+
<br></br>
|
62 |
+
If you are deploying on a 'bare metal' machine running Ubuntu, you may need
|
63 |
+
to install the required Nvidia drivers and CUDA. The following commands show
|
64 |
+
how to retrieve the latest drivers for a machine running Ubuntu 20.04 as an
|
65 |
+
example. You can update the following based on your respective operating system.
|
66 |
+
</p>
|
67 |
+
<pre>
|
68 |
+
<code>
|
69 |
+
wget
|
70 |
+
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin{" "}
|
71 |
+
<br></br>
|
72 |
+
sudo mv cuda-ubuntu2004.pin
|
73 |
+
/etc/apt/preferences.d/cuda-repository-pin-600 <br></br>
|
74 |
+
wget
|
75 |
+
https://developer.download.nvidia.com/compute/cuda/11.4.3/local_installers/cuda-repo-ubuntu2004-11-4-local_11.4.3-470.82.01-1_amd64.deb{" "}
|
76 |
+
<br></br>
|
77 |
+
sudo dpkg -i
|
78 |
+
cuda-repo-ubuntu2004-11-4-local_11.4.3-470.82.01-1_amd64.deb <br></br>
|
79 |
+
sudo apt-key add /var/cuda-repo-ubuntu2004-11-4-local/7fa2af80.pub <br></br>
|
80 |
+
sudo apt-get -y update <br></br>
|
81 |
+
sudo apt-get -y install cuda
|
82 |
+
</code>
|
83 |
+
</pre>
|
84 |
+
<p>
|
85 |
+
<b>Create virtual environment (pipenv) </b>
|
86 |
+
<br></br>
|
87 |
+
The following command creates a virtual environment using pipenv and will install
|
88 |
+
the dependencies using pipenv.
|
89 |
+
<pre>
|
90 |
+
<code>make setup</code>
|
91 |
+
</pre>
|
92 |
+
</p>
|
93 |
+
</TabItem>
|
94 |
+
<TabItem value="using-requirements" label="Using requirements.txt">
|
95 |
+
<p>
|
96 |
+
If you wish to use conda or another virtual environment, you can also
|
97 |
+
install the dependencies using the <code>requirements.txt</code>{" "}
|
98 |
+
file.{" "}
|
99 |
+
</p>
|
100 |
+
<pre>
|
101 |
+
<code>pip install -r requirements.txt</code>
|
102 |
+
</pre>
|
103 |
+
</TabItem>
|
104 |
+
<TabItem value="wsl2-install" label="Windows installation" default>
|
105 |
+
<p>
|
106 |
+
Follow the steps below to install H2O LLM Studio on a Windows machine
|
107 |
+
using Windows Subsystem for Linux{" "}
|
108 |
+
<a href="https://learn.microsoft.com/en-us/windows/wsl/">WSL2</a>
|
109 |
+
</p>
|
110 |
+
<p>
|
111 |
+
1. Download the{" "}
|
112 |
+
<a href="https://www.nvidia.com/download/index.aspx">
|
113 |
+
latest nvidia driver
|
114 |
+
</a>{" "}
|
115 |
+
for Windows.{" "}
|
116 |
+
</p>
|
117 |
+
<p>
|
118 |
+
2. Open PowerShell or a Windows Command Prompt window in administrator
|
119 |
+
mode.{" "}
|
120 |
+
</p>
|
121 |
+
<p>
|
122 |
+
3. Run the following command to confirm that the driver is installed
|
123 |
+
properly and see the driver version.
|
124 |
+
<pre>
|
125 |
+
<code>nvidia-smi</code>
|
126 |
+
</pre>
|
127 |
+
</p>
|
128 |
+
<p>
|
129 |
+
4. Run the following command to install WSL2.
|
130 |
+
<pre>
|
131 |
+
<code>wsl --install</code>
|
132 |
+
</pre>
|
133 |
+
</p>
|
134 |
+
<p>5. Launch the WSL2 Ubuntu installation. </p>
|
135 |
+
<p>
|
136 |
+
6. Install the{" "}
|
137 |
+
<a href="https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0">
|
138 |
+
WSL2 Nvidia Cuda Drivers
|
139 |
+
</a>
|
140 |
+
.
|
141 |
+
<pre>
|
142 |
+
<code>
|
143 |
+
wget
|
144 |
+
https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin{" "}
|
145 |
+
<br></br>
|
146 |
+
sudo mv cuda-ubuntu2004.pin
|
147 |
+
/etc/apt/preferences.d/cuda-repository-pin-600 <br></br>
|
148 |
+
wget
|
149 |
+
https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda-repo-wsl-ubuntu-12-2-local_12.2.0-1_amd64.deb{" "}
|
150 |
+
<br></br>
|
151 |
+
sudo dpkg -i cuda-repo-wsl-ubuntu-12-2-local_12.2.0-1_amd64.deb <br></br>
|
152 |
+
sudo cp /var/cuda-repo-wsl-ubuntu-12-2-local/cuda-*-keyring.gpg
|
153 |
+
/usr/share/keyrings/ <br></br>
|
154 |
+
sudo apt-get update <br></br>
|
155 |
+
sudo apt-get -y install cuda
|
156 |
+
</code>
|
157 |
+
</pre>
|
158 |
+
</p>
|
159 |
+
<p>
|
160 |
+
7. Set up the required python system installs (Python 3.10).
|
161 |
+
<pre>
|
162 |
+
<code>
|
163 |
+
sudo add-apt-repository ppa:deadsnakes/ppa <br></br>
|
164 |
+
sudo apt install python3.10 <br></br>
|
165 |
+
sudo apt-get install python3.10-distutils <br></br>
|
166 |
+
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
|
167 |
+
</code>
|
168 |
+
</pre>
|
169 |
+
</p>
|
170 |
+
<p>
|
171 |
+
8. Create the virtual environment.
|
172 |
+
<pre>
|
173 |
+
<code>
|
174 |
+
sudo apt install -y python3.10-venv<br></br>
|
175 |
+
python3 -m venv llmstudio<br></br>
|
176 |
+
source llmstudio/bin/activate<br></br>
|
177 |
+
</code>
|
178 |
+
</pre>
|
179 |
+
</p>
|
180 |
+
<p>
|
181 |
+
9.Clone the H2O LLM Studio repository locally.
|
182 |
+
<pre>
|
183 |
+
<code>
|
184 |
+
git clone https://github.com/h2oai/h2o-llmstudio.git<br></br>
|
185 |
+
cd h2o-llmstudio
|
186 |
+
</code>
|
187 |
+
</pre>
|
188 |
+
</p>
|
189 |
+
<p>
|
190 |
+
10. Install H2O LLM Studio using the `requirements.txt`.
|
191 |
+
<pre>
|
192 |
+
<code>pip install -r requirements.txt</code>
|
193 |
+
</pre>
|
194 |
+
</p>
|
195 |
+
<p>
|
196 |
+
11. Run the H2O LLM Studio application.
|
197 |
+
<pre>
|
198 |
+
<code>
|
199 |
+
H2O_WAVE_MAX_REQUEST_SIZE=25MB \ <br></br>
|
200 |
+
H2O_WAVE_NO_LOG=True \ <br></br>
|
201 |
+
H2O_WAVE_PRIVATE_DIR="/download/@output/download" \ <br></br>
|
202 |
+
wave run llm_studio.app
|
203 |
+
</code>
|
204 |
+
</pre>
|
205 |
+
</p>
|
206 |
+
<p>
|
207 |
+
This will start the H2O Wave server and the H2O LLM Studio app. Navigate
|
208 |
+
to <a>http://localhost:10101/</a> (we recommend using Chrome) to access
|
209 |
+
H2O LLM Studio and start fine-tuning your models.
|
210 |
+
</p>
|
211 |
+
</TabItem>
|
212 |
+
</Tabs>
|
213 |
+
:::
|
214 |
+
|
215 |
+
## Install custom package
|
216 |
+
|
217 |
+
If required, you can install additional Python packages into your environment. This can be done using pip after activating your virtual environment via `make shell`. For example, to install flash-attention, you would use the following commands:
|
218 |
+
|
219 |
+
```bash
|
220 |
+
make shell
|
221 |
+
pip install flash-attn --no-build-isolation
|
222 |
+
pip install git+https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/rotary
|
223 |
+
```
|
224 |
+
|
225 |
+
Alternatively, you can also directly install the custom package by running the following command.
|
226 |
+
|
227 |
+
```bash
|
228 |
+
pipenv install package_name
|
229 |
+
```
|
230 |
+
|
231 |
+
## Run H2O LLM Studio
|
232 |
+
|
233 |
+
There are several ways to run H2O LLM Studio depending on your requirements.
|
234 |
+
|
235 |
+
1. [Run H2O LLM Studio GUI](#run-h2o-llm-studio-gui)
|
236 |
+
2. [Run using Docker](#run-using-docker)
|
237 |
+
3. [Run by building your own Docker image](#run-by-building-your-own-docker-image)
|
238 |
+
4. [Run with the CLI (command-line interface)](#run-with-command-line-interface-cli)
|
239 |
+
|
240 |
+
### Run H2O LLM Studio GUI
|
241 |
+
|
242 |
+
Run the following command to start the H2O LLM Studio.
|
243 |
+
|
244 |
+
```sh
|
245 |
+
make llmstudio
|
246 |
+
```
|
247 |
+
|
248 |
+
This will start the H2O Wave server and the H2O LLM Studio app. Navigate to [http://localhost:10101/](http://localhost:10101/) (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models.
|
249 |
+
|
250 |
+

|
251 |
+
|
252 |
+
If you are running H2O LLM Studio with a custom environment other than Pipenv, start the app as follows:
|
253 |
+
|
254 |
+
```sh
|
255 |
+
H2O_WAVE_MAX_REQUEST_SIZE=25MB \
|
256 |
+
H2O_WAVE_NO_LOG=True \
|
257 |
+
H2O_WAVE_PRIVATE_DIR="/download/@output/download" \
|
258 |
+
wave run llm_studio.app
|
259 |
+
```
|
260 |
+
|
261 |
+
### Run using Docker
|
262 |
+
|
263 |
+
First, install Docker by following the instructions from the [NVIDIA Container Installation Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). H2O LLM Studio images are stored in the `h2oai dockerhub` container repository.
|
264 |
+
|
265 |
+
```sh
|
266 |
+
mkdir -p `pwd`/llmstudio_mnt
|
267 |
+
docker run \
|
268 |
+
--runtime=nvidia \
|
269 |
+
--shm-size=64g \
|
270 |
+
--init \
|
271 |
+
--rm \
|
272 |
+
-it \
|
273 |
+
-p 10101:10101 \
|
274 |
+
-v `pwd`/llmstudio_mnt:/home/llmstudio/mount \
|
275 |
+
-v ~/.cache:/home/llmstudio/.cache \
|
276 |
+
h2oairelease/h2oai-llmstudio-app:latest
|
277 |
+
```
|
278 |
+
|
279 |
+
Navigate to [http://localhost:10101/](http://localhost:10101/) (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models.
|
280 |
+
|
281 |
+
:::info
|
282 |
+
Other helpful docker commands are `docker ps` and `docker kill`.
|
283 |
+
:::
|
284 |
+
|
285 |
+
### Run by building your own Docker image
|
286 |
+
|
287 |
+
```sh
|
288 |
+
docker build -t h2o-llmstudio .
|
289 |
+
mkdir -p `pwd`/llmstudio_mnt
|
290 |
+
docker run \
|
291 |
+
--runtime=nvidia \
|
292 |
+
--shm-size=64g \
|
293 |
+
--init \
|
294 |
+
--rm \
|
295 |
+
-it \
|
296 |
+
-p 10101:10101 \
|
297 |
+
-v `pwd`/llmstudio_mnt:/home/llmstudio/mount \
|
298 |
+
-v ~/.cache:/home/llmstudio/.cache \
|
299 |
+
h2o-llmstudio
|
300 |
+
```
|
301 |
+
|
302 |
+
### Run with command line interface (CLI)
|
303 |
+
|
304 |
+
You can also use H2O LLM Studio with the command line interface (CLI) and specify the configuration .yaml file that contains all the experiment parameters. To finetune using H2O LLM Studio with CLI, activate the pipenv environment by running `make shell`.
|
305 |
+
|
306 |
+
To specify the path to the configuration file that contains the experiment parameters, run:
|
307 |
+
|
308 |
+
```sh
|
309 |
+
python llm_studio/train.py -Y {path_to_config_yaml_file}
|
310 |
+
```
|
311 |
+
|
312 |
+
To run on multiple GPUs in DDP mode, run:
|
313 |
+
|
314 |
+
```sh
|
315 |
+
bash distributed_train.sh {NR_OF_GPUS} -Y {path_to_config_yaml_file}
|
316 |
+
```
|
317 |
+
|
318 |
+
:::info
|
319 |
+
By default, the framework will run on the first `k` GPUs. If you want to specify specific GPUs to run on, use the `CUDA_VISIBLE_DEVICES` environment variable before the command.
|
320 |
+
:::
|
321 |
+
|
322 |
+
To start an interactive chat with your trained model, run:
|
323 |
+
|
324 |
+
```sh
|
325 |
+
python llm_studio/prompt.py -e {experiment_name}
|
326 |
+
```
|
327 |
+
|
328 |
+
`experiment_name` is the output folder of the experiment you want to chat with. The interactive chat will also work with models that were fine-tuned using the GUI.
|
documentation/docs/get-started/videos.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Learn from a collection of videos about LLM Studio.
|
3 |
+
---
|
4 |
+
import ReactPlayer from 'react-player'
|
5 |
+
|
6 |
+
|
7 |
+
# Videos
|
8 |
+
|
9 |
+
## Discovering the Potential of LLMs
|
10 |
+
|
11 |
+
<iframe width="930" height="515" src="https://www.youtube.com/embed/u48QaIAIFw4" title="Discovering the Potential of LLMs: A Journey through H2O.ai's LLM Studio!" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
|
12 |
+
|
13 |
+
|
14 |
+
:::info Note
|
15 |
+
In this video, Andreea Turcu delves in-depth into the world of language models, showcasing how users can use H2O.ai's LLM Studio to their full advantage.
|
16 |
+
:::
|
17 |
+
|
18 |
+
---
|
19 |
+
|
20 |
+
## The Fine Art of Fine-Tuning Large Language Models
|
21 |
+
|
22 |
+
<iframe width="930" height="515" src="https://www.youtube.com/embed/YWAS3QDFg40" title="The Fine Art of Fine-Tuning LLMs" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
|
23 |
+
|
24 |
+
|
25 |
+
:::info Note
|
26 |
+
In this video, Pascal Pfeiffer, Principal Data Scientist at H2O.ai and Kaggle Grandmaster, announces the release of H2O LLM Studio and talks about fine-tuning LLMs using H2O LLM Studio at H2O World India 2023.
|
27 |
+
:::
|
28 |
+
|
29 |
+
---
|
30 |
+
|
31 |
+
## Basic introduction to H2O LLM Studio
|
32 |
+
|
33 |
+
<iframe width="930" height="515" src="https://www.youtube.com/embed/aFU3VRGE2gk" title="Introduction to H2O LLM Studio" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
|
34 |
+
|
35 |
+
|
36 |
+
:::info Note
|
37 |
+
In this video, Avkash Chauhan, founder of Prodramp Inc, gives a basic introduction about H2O LLM Studio.
|
38 |
+
:::
|
39 |
+
|
40 |
+
----
|
41 |
+
|
42 |
+
## LLM Fine-Tuning, Falcon 40b, and the State of Open-Source
|
43 |
+
|
44 |
+
<iframe width="930" height="515" src="https://www.youtube.com/embed/Ur-1PI9SMfw" title="Pascal Pfeiffer - Kaggle, Fine-Tuning, H2O.ai, GPT4, Falcon 40b, Open Source" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
|
45 |
+
|
46 |
+
|
47 |
+
:::info Note
|
48 |
+
In this video, Pascal Pfeiffer, the Principal Data Scientist at h2o.ai is interviewed about LLM fine-tuning, being a Kaggle Grandmaster, H2O.ai, Falcon 40b, the state of open-source, and more.
|
49 |
+
:::
|
documentation/docs/get-started/what-is-h2o-llm-studio.md
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: H2O LLM Studio is an open-source, no-code LLM graphical user interface (GUI) designed for fine-tuning state-of-the-art large language models.
|
3 |
+
---
|
4 |
+
# What is H2O LLM Studio?
|
5 |
+
|
6 |
+
H2O LLM Studio is an open-source, no-code [LLM](../concepts#llm) graphical user interface (GUI) designed for fine-tuning state-of-the-art large language models.
|
7 |
+
|
8 |
+
[Fine-tuning](../concepts#fine-tuning) a pretrained language model requires coding expertise and extensive knowledge about the model and its [hyperparameters](../concepts#parameters-and-hyperparameters), however H2O LLM Studio enables NLP practitioners to fine-tune their LLMs easily with no need for coding and better flexibility over customization.
|
9 |
+
|
10 |
+
H2O LLM Studio also lets you chat with the fine-tuned model and receive instant feedback about model performance.
|
11 |
+
|
12 |
+
## Who is H2O LLM Studio for?
|
13 |
+
|
14 |
+
H2O LLM Studio is a free and open-source tool that is designed for anyone who wants to fine-tune their own language models. It is designed to be easy to use and accessible to everyone regardless of their technical expertise.
|
15 |
+
|
16 |
+
NLP practitioners and data scientists in particular may find it useful to easily and effectively create and fine-tune large language models.
|
documentation/docs/guide/datasets/configure-dataset.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/data-connectors-format.md
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Supported data connectors and format
|
2 |
+
|
3 |
+
## Data connectors
|
4 |
+
|
5 |
+
H2O LLM Studio supports the following data connectors to access or upload external data sources.
|
6 |
+
|
7 |
+
- **Upload**: Upload a local dataset from your machine.
|
8 |
+
- **Local**: Specify the file location of the dataset on your machine.
|
9 |
+
- **AWS S3 (Amazon AWS S3)**: Connect to an Amazon AWS S3 data bucket.
|
10 |
+
- **Azure Datalake**: Connect to a dataset in Azure Datalake.
|
11 |
+
- **H2O Drive**: Upload a dataset from H2O Drive.
|
12 |
+
- **Kaggle**: Connect to a dataset hosted on Kaggle.
|
13 |
+
- **Hugging Face**: Connect to a dataset on Hugging Face.
|
14 |
+
|
15 |
+
## Data format
|
16 |
+
|
17 |
+
- Each data connector requires either a single `.csv` or `.pq` file, or the data to be in a `.zip` file for a successful import.
|
18 |
+
|
19 |
+
- H2O LLM studio requires a `.csv` file with a minimum of two columns, where one contains the instructions and the other has the model’s expected output. You can also include an additional validation dataframe in the same format or allow for an automatic train/validation split to assess the model’s performance.
|
20 |
+
|
21 |
+
- Optionally, a **Parent Id** can be used for training nested data prompts that are linked to a parent question.
|
22 |
+
|
23 |
+
- During an experiment you can adapt the data representation with the following settings:
|
24 |
+
- **Prompt Column:** The column in the dataset containing the user prompt.
|
25 |
+
- **Answer Column:** The column in the dataset containing the expected output.
|
26 |
+
- **Parent Id Column:** An optional column specifying the parent id to be used for chained conversations. The value of this column needs to match an additional column with the name `id`. If provided, the prompt will be concatenated after preceding parent rows.
|
27 |
+
- **Id Column:** This column is only required when the `Parent Id` is set. It identifies the record ID used for linked conversations. The value in the `Parent Id` column must match this column's value.
|
28 |
+
|
29 |
+
:::info
|
30 |
+
To train a chatbot style model, you need to convert your data into a question and answer format. There are other enterprise solutions by H2O.ai that may help you prep your data. For more information, see [H2O.ai's Generative AI page](https://h2o.ai/) and this blogpost about [H2O LLM DataStudio: Streamlining Data Curation and Data Preparation for LLMs related tasks](https://h2o.ai/blog/2023/streamlining-data-preparation-for-fine-tuning-of-large-language-models/).
|
31 |
+
|
32 |
+
## Example data
|
33 |
+
|
34 |
+
H2O LLM Studio provides a sample dataset (converted dataset from [OpenAssistant/oasst2](https://huggingface.co/datasets/OpenAssistant/oasst2))
|
35 |
+
that can be downloaded [here](https://www.kaggle.com/code/philippsinger/openassistant-conversations-dataset-oasst2?scriptVersionId=160485459). It is recommended to use `train_full.csv` for training. This dataset is also downloaded and prepared by default when first starting the GUI. Multiple dataframes can be uploaded into a single dataset by uploading a `.zip` archive.
|
documentation/docs/guide/datasets/import-dataset.md
ADDED
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: H2O LLM Studio provides a number of data connectors to support importing data from local or external sources and requires your data to be in a certain format for successful importing of data.
|
3 |
+
---
|
4 |
+
import Tabs from '@theme/Tabs';
|
5 |
+
import TabItem from '@theme/TabItem';
|
6 |
+
import Admonition from '@theme/Admonition';
|
7 |
+
import upload_dataset from './upload-dataset.png';
|
8 |
+
import upload_local_file from './upload-local-file.png';
|
9 |
+
import import_s3_bucket from './import-s3-bucket.png';
|
10 |
+
import import_kaggle_dataset from './import-kaggle-dataset.png';
|
11 |
+
import import_h2odrive_dataset from './import-h2o-drive-dataset.png';
|
12 |
+
import DatasetNameTooltip from '../../tooltips/experiments/_dataset-name.mdx';
|
13 |
+
import ProblemTypeTooltip from '../../tooltips/experiments/_problem-type.mdx';
|
14 |
+
import TrainDataframeTooltip from '../../tooltips/experiments/_train-dataframe.mdx';
|
15 |
+
import ValidationDataframeTooltip from '../../tooltips/experiments/_validation-dataframe.mdx';
|
16 |
+
import SystemColumnTooltip from '../../tooltips/experiments/_system-column.mdx';
|
17 |
+
import PromptColumnTooltip from '../../tooltips/experiments/_prompt-column.mdx';
|
18 |
+
import RejectedPromptColumnTooltip from '../../tooltips/experiments/_rejected-prompt-column.mdx';
|
19 |
+
import AnswerColumnTooltip from '../../tooltips/experiments/_answer-column.mdx';
|
20 |
+
import RejectedAnswerColumnTooltip from '../../tooltips/experiments/_rejected-answer-column.mdx';
|
21 |
+
import ParentIdColumnTooltip from '../../tooltips/experiments/_parent-id-column.mdx';
|
22 |
+
|
23 |
+
# Import a dataset
|
24 |
+
|
25 |
+
H2O LLM Studio provides a number of data connectors to support importing data from local or external sources and requires your data to be in a certain format for successful importing of data.
|
26 |
+
|
27 |
+
For more information, see [Supported data connectors and format](data-connectors-format).
|
28 |
+
|
29 |
+
## Import data
|
30 |
+
|
31 |
+
Follow the relevant steps below to import a dataset to H2O LLM Studio.
|
32 |
+
|
33 |
+
1. On the H2O LLM Studio left-navigation pane, click **Import dataset**.
|
34 |
+
2. Select the relevant **Source** (data connector) that you want to use from the dropdown list .
|
35 |
+
:::note Data sources
|
36 |
+
<Tabs className="unique-tabs">
|
37 |
+
<TabItem value="upload" label="Upload" default>
|
38 |
+
<ol>
|
39 |
+
<li>
|
40 |
+
Drag and drop the file, or click <b>Browse</b> and select the file you want to upload.
|
41 |
+
</li>
|
42 |
+
<li>
|
43 |
+
Click <b>Upload</b>.
|
44 |
+
<img src={upload_dataset} alt="upload-dataset" />
|
45 |
+
</li>
|
46 |
+
</ol>
|
47 |
+
</TabItem>
|
48 |
+
<TabItem value="local" label="Local">
|
49 |
+
<ol>
|
50 |
+
<li>
|
51 |
+
Enter the file path as the <b>File Location</b> or select the relevant local directory that the dataset is located in.
|
52 |
+
</li>
|
53 |
+
<li>
|
54 |
+
Click <b>Continue</b>.
|
55 |
+
<img src={upload_local_file} alt="upload-local-file" />
|
56 |
+
</li>
|
57 |
+
</ol>
|
58 |
+
</TabItem>
|
59 |
+
<TabItem value="aws" label="AWS S3">
|
60 |
+
<ol>
|
61 |
+
<li>
|
62 |
+
Enter values for the following fields:
|
63 |
+
<ul>
|
64 |
+
<li>
|
65 |
+
<b>S3 bucket name: </b> <br></br>
|
66 |
+
The name of the S3 bucket including the reletive file paths.
|
67 |
+
</li>
|
68 |
+
<li>
|
69 |
+
<b>AWS access key: </b><br></br>
|
70 |
+
The access key associated with your S3 bucket. This field is optional. If the S3 bucket is public, you can leave this empty for anonymous access.
|
71 |
+
</li>
|
72 |
+
<li>
|
73 |
+
<b>AWS access secret: </b><br></br>
|
74 |
+
The access secret associated with your S3 bucket. This field is optional. If the S3 bucket is public, you can leave this empty for anonymous access.
|
75 |
+
</li>
|
76 |
+
<li>
|
77 |
+
<b>File name: </b><br></br>
|
78 |
+
Enter the file name of the dataset that you want to import.
|
79 |
+
</li>
|
80 |
+
</ul>
|
81 |
+
<div>
|
82 |
+
<Admonition type="info" title="Note">
|
83 |
+
<p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-creds.html#access-keys-and-secret-access-keys">AWS credentials</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a> in the AWS Documentation.</p>
|
84 |
+
</Admonition>
|
85 |
+
</div>
|
86 |
+
</li>
|
87 |
+
<li>
|
88 |
+
Click <b>Continue</b>.
|
89 |
+
<img src={import_s3_bucket} alt="import-s3-bucket" />
|
90 |
+
</li>
|
91 |
+
</ol>
|
92 |
+
</TabItem>
|
93 |
+
<TabItem value="azure datalake" label="Azure Datalake">
|
94 |
+
<ol>
|
95 |
+
<li>
|
96 |
+
Enter values for the following fields:
|
97 |
+
<ul>
|
98 |
+
<li>
|
99 |
+
<b>Datalake connection string: </b><br></br>
|
100 |
+
Enter your Azure connection string to connect to Datalake storage.
|
101 |
+
</li>
|
102 |
+
<li>
|
103 |
+
<b>Datalake container name: </b><br></br>
|
104 |
+
Enter the name of the Azure Data Lake container where your dataset is stored, including the relative path to the file within the container.
|
105 |
+
</li>
|
106 |
+
<li>
|
107 |
+
<b>File name: </b><br></br>
|
108 |
+
Specify the exact name of the file you want to import.
|
109 |
+
</li>
|
110 |
+
</ul>
|
111 |
+
</li>
|
112 |
+
<li>
|
113 |
+
Click <b>Continue</b>.
|
114 |
+
</li>
|
115 |
+
</ol>
|
116 |
+
</TabItem>
|
117 |
+
<TabItem value="h2o-drive" label="H2O-Drive">
|
118 |
+
<ol>
|
119 |
+
<li>
|
120 |
+
Select the dataset you want to upload from the list of datasets in H2O Drive.
|
121 |
+
</li>
|
122 |
+
<li>
|
123 |
+
Click <b>Continue</b>.
|
124 |
+
<img src={import_h2odrive_dataset} alt="import-h2odrive-dataset" />
|
125 |
+
</li>
|
126 |
+
</ol>
|
127 |
+
</TabItem>
|
128 |
+
<TabItem value="kaggle" label="Kaggle">
|
129 |
+
<ol>
|
130 |
+
<li>
|
131 |
+
Enter values for the following fields:
|
132 |
+
<ul>
|
133 |
+
<li>
|
134 |
+
<b>Kaggle API command: </b><br></br>
|
135 |
+
Enter the Kaggle API command that you want to execute.
|
136 |
+
</li>
|
137 |
+
<li>
|
138 |
+
<b>Kaggle username: </b><br></br>
|
139 |
+
Your Kaggle username for API authentication
|
140 |
+
</li>
|
141 |
+
<li>
|
142 |
+
<b>Kaggle secret key: </b><br></br>
|
143 |
+
Your Kaggle secret key for API authentication.
|
144 |
+
</li>
|
145 |
+
</ul>
|
146 |
+
</li>
|
147 |
+
<li>
|
148 |
+
Click <b>Continue</b>.
|
149 |
+
<img src={import_kaggle_dataset} alt="import-kaggle-dataset" />
|
150 |
+
</li>
|
151 |
+
</ol>
|
152 |
+
</TabItem>
|
153 |
+
<TabItem value="hugging face" label="Hugging Face">
|
154 |
+
<ol>
|
155 |
+
<li>
|
156 |
+
Enter values for the following fields:
|
157 |
+
<ul>
|
158 |
+
<li>
|
159 |
+
<b>Hugging Face dataset: </b><br></br>
|
160 |
+
Enter the name of the Hugging Face dataset.
|
161 |
+
</li>
|
162 |
+
<li>
|
163 |
+
<b>Split: </b><br></br>
|
164 |
+
Enter the specific data split you want to import (e.g., "train", "test").
|
165 |
+
</li>
|
166 |
+
<li>
|
167 |
+
<b>Hugging Face API token (optional): </b><br></br>
|
168 |
+
Enter your Hugging Face API token to authenticate access to private datasets or datasets with gated access.
|
169 |
+
</li>
|
170 |
+
</ul>
|
171 |
+
</li>
|
172 |
+
<li>
|
173 |
+
Click <b>Continue</b>.
|
174 |
+
</li>
|
175 |
+
</ol>
|
176 |
+
</TabItem>
|
177 |
+
</Tabs>
|
178 |
+
:::
|
179 |
+
|
180 |
+
## Configure dataset
|
181 |
+
|
182 |
+
Once you have successfully uploaded or imported your dataset, you can configure the dataset settings. Depending on the problem type, you may need to specify the following:
|
183 |
+
|
184 |
+
:::info Tip
|
185 |
+
You can upload a `.zip` file with both training and validation sets to avoid having to separately upload files.
|
186 |
+
:::
|
187 |
+
|
188 |
+
- **Dataset name:** <DatasetNameTooltip/>
|
189 |
+
|
190 |
+
- **Problem Type:** <ProblemTypeTooltip/>
|
191 |
+
|
192 |
+
- **Train Dataframe:** <TrainDataframeTooltip/>
|
193 |
+
|
194 |
+
- **Validation Dataframe:** <ValidationDataframeTooltip/>
|
195 |
+
|
196 |
+
- **System Column:** <SystemColumnTooltip/>
|
197 |
+
|
198 |
+
- **Prompt Column:** <PromptColumnTooltip/>
|
199 |
+
|
200 |
+
- **Rejected Prompt Column:** <RejectedPromptColumnTooltip/>
|
201 |
+
|
202 |
+
- #### **Answer Column:**
|
203 |
+
|
204 |
+
<AnswerColumnTooltip/>
|
205 |
+
|
206 |
+
- **Rejected Answer Column:** <RejectedAnswerColumnTooltip/>
|
207 |
+
|
208 |
+
- **Parent Id Column:** <ParentIdColumnTooltip/>
|
209 |
+
|
210 |
+

|
211 |
+
|
212 |
+
## Data validity check
|
213 |
+
|
214 |
+
H2O LLM Studio will provide a preview of the dataset input (sample questions) and output (sample answers) according to the content of the imported dataset. Review the text to ensure that the input and output is as intended, and then click **Continue**.
|
215 |
+
|
216 |
+
## View dataset
|
217 |
+
|
218 |
+
You will now be redirected to the **View datasets** screen. You should be able to see the dataset you just imported listed on the screen.
|
219 |
+
|
220 |
+

|
221 |
+
|
222 |
+
For more information about viewing dataset summary and statistics, see [View and manage datasets](view-dataset)
|
documentation/docs/guide/datasets/import-h2o-drive-dataset.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/import-kaggle-dataset.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/import-s3-bucket.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/merge-datasets.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: H2O LLM Studio enables you to merge imported datasets into one main dataset. This functionality can be used to merge training and validation data together into one dataset or extend your existing dataset with more data and increase your dataset size.
|
3 |
+
---
|
4 |
+
import Icon from "@material-ui/core/Icon";
|
5 |
+
|
6 |
+
# Merge datasets
|
7 |
+
|
8 |
+
H2O LLM Studio enables you to merge imported datasets into one main dataset. This functionality can be used to merge training and validation data together into one dataset or extend your existing dataset with more data and increase your dataset size.
|
9 |
+
|
10 |
+
:::info
|
11 |
+
H2O LLM Studio does not merge dataset files in the sense that rows are combined, and duplicate rows are removed. "Merge", in this case, refers to bringing the dataset files a dataset might have to a single dataset (another dataset), continuing other dataset files already.
|
12 |
+
:::
|
13 |
+
|
14 |
+
Generally, you might want to merge datasets in H2O LLM Studio to have both the training data .csv and validation data .csv in one final dataset.
|
15 |
+
|
16 |
+
1. On the H2O LLM Studio left-navigation pane, click **View datasets**.
|
17 |
+
2. Click the <Icon>more_vert</Icon> Kebab menu of the dataset you want to merge with.
|
18 |
+
3. Click **Edit dataset**.
|
19 |
+
4. Click **Merge with existing dataset**.
|
20 |
+
5. Select the dataset you want that you want to merge with.
|
21 |
+

|
22 |
+
6. Click **Merge**.
|
23 |
+
7. Adjust the dataset configuration if needed. For more information about the configurations, see [Configure dataset](./import-dataset#configure-dataset).
|
24 |
+
8. Click **Continue**.
|
25 |
+
9. Review the text to ensure that the input and output is as intended, and then click **Continue**.
|
26 |
+
|
27 |
+
Your datasets are now merged.
|
28 |
+
|
29 |
+
:::info
|
30 |
+
Alternatively, you can also merge datasets at the point of [importing a dataset](./import-dataset) or combine both datasets (.csv files) into a `.zip` file before uploading it as a whole dataset.
|
31 |
+
:::
|
32 |
+
|
33 |
+
|
34 |
+
|
documentation/docs/guide/datasets/merge-datasets.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/upload-dataset.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/upload-local-file.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/datasets/view-dataset.md
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: You can view, review, edit, or delete your datasets once you have imported them. You can also start a new experiment using a dataset you have imported.
|
3 |
+
---
|
4 |
+
import Icon from "@material-ui/core/Icon";
|
5 |
+
|
6 |
+
# View and manage dataset
|
7 |
+
|
8 |
+
You can view, review, edit, or delete your datasets once you have imported them. You can also start a new experiment using a dataset you have imported.
|
9 |
+
|
10 |
+
## View a dataset
|
11 |
+
|
12 |
+
To view an imported dataset:
|
13 |
+
|
14 |
+
1. On the H2O LLM Studio left-navigation pane, click **View datasets**.
|
15 |
+
|
16 |
+
2. You will see the datasets table with a list of all the datasets you have imported so far. Click the name of the dataset that you want to view.
|
17 |
+
|
18 |
+

|
19 |
+
|
20 |
+
:::info
|
21 |
+
For more information about the dataset details you see on the table above, see [dataset configurations](import-dataset.md#configure-a-dataset).
|
22 |
+
:::
|
23 |
+
|
24 |
+
## Dataset tabs
|
25 |
+
|
26 |
+
You will see the following tabs that provide details and different aspects of your dataset.
|
27 |
+
|
28 |
+
- **Sample train data** : This tab contains sample training data from the imported dataset.
|
29 |
+
|
30 |
+
- **Sample train visualization:** This tab visualizes a few sample training data from the imported dataset in a question-answer format; simulating the way the chatbot would answer questions based on the training data.
|
31 |
+
|
32 |
+
- **Train data statistics:** This tab contains metrics about the training data (e.g., unique values) from the imported dataset.
|
33 |
+
|
34 |
+
- **Summary:** This tab contains the following details about the dataset.
|
35 |
+
|
36 |
+
| Name | Description |
|
37 |
+
| ----------- | ------------------------------------ |
|
38 |
+
| **Name** | Name of the dataset. |
|
39 |
+
| **Problem type** | Problem type of the dataset. |
|
40 |
+
| **Train dataframe** | Name of the training dataframe in the imported dataset. An imported dataset can contain train, test, and validation dataframes. |
|
41 |
+
| **Train rows** | The number of rows the train dataframe contains. |
|
42 |
+
| **Validation dataframe** | Name of the validation dataframe in the imported dataset. An imported dataset can contain train, test, and validation dataframes. |
|
43 |
+
| **Validation rows** | The number of rows the validation dataframe contains. |
|
44 |
+
| **Labels** | The labels the imported dataset contains. |
|
45 |
+
|
46 |
+
|
47 |
+
## Edit a dataset
|
48 |
+
|
49 |
+
To edit an imported dataset,
|
50 |
+
|
51 |
+
1. On the H2O LLM Studio left-navigation pane, click **View datasets**. You will see the datasets table with a list of all the datasets you have imported so far.
|
52 |
+
2. Locate the row of the dataset you want to edit and click the <Icon>more_vert</Icon> Kebab menu.
|
53 |
+
3. Select **Edit dataset**.
|
54 |
+
4. Make the desired changes to the dataset configuration. You can also [merge the dataset with an existing dataset](merge-datasets) at this point.
|
55 |
+
5. Click **Continue** and review the dataset with your changes.
|
56 |
+
|
57 |
+
<!--
|
58 |
+
## Start a new experiment
|
59 |
+
|
60 |
+
|
61 |
+
link to start a new experiment page in the experiments sub page. -->
|
62 |
+
|
63 |
+
## Delete a dataset
|
64 |
+
|
65 |
+
When a dataset is no longer needed, you can delete it. Deleted datasets are permanently removed from the H2O LLM Studio instance.
|
66 |
+
|
67 |
+
:::caution
|
68 |
+
You can only delete datasets that are not linked to any experiments. If you wish to delete a dataset that is linked to an experiment, first [delete the experiment](../experiments/view-an-experiment#delete-an-experiment), and then delete the dataset.
|
69 |
+
:::
|
70 |
+
|
71 |
+
1. On the H2O LLM Studio left-navigation pane, click **View datasets**.
|
72 |
+
2. Click **Delete datasets**.
|
73 |
+
3. Select the dataset(s) that you want to delete.
|
74 |
+
4. Click **Delete** to confirm deletion.
|
documentation/docs/guide/datasets/view-imported-dataset.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/best-validation-sample.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/charts-tab.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/chat-tab.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/compare-experiments.md
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Using H2O LLM Studio, you can compare experiments and analyze how different model parameters affect model performance.
|
3 |
+
---
|
4 |
+
# Compare experiments
|
5 |
+
|
6 |
+
Using H2O LLM Studio, you can compare experiments and analyze how different model parameters affect model performance.
|
7 |
+
|
8 |
+
Follow the relevant steps below to compare experiments in H2O LLM Studio.
|
9 |
+
|
10 |
+
1. On the H2O LLM Studio left-navigation pane, click **View experiments**.
|
11 |
+
2. Click **Compare experiments**.
|
12 |
+
3. Select the experiments you want to compare.
|
13 |
+
4. Click **Compare experiments**.
|
14 |
+
|
15 |
+

|
16 |
+
|
17 |
+
The **Charts** tab visually represents the comparison of train/validation loss, metrics, and learning rate of selected experiments. The **Config** tab compares the configuration settings of selected experiments.
|
18 |
+
|
19 |
+
:::info note
|
20 |
+
In addition, H2O LLM Studio also integrates with [Neptune](https://neptune.ai/) and [W&B](https://wandb.ai/), two powerful experiment tracking platforms. By enabling Neptune or W&B logging when starting an experiment, you can easily track and visualize all aspects of your experiment in real time. This includes model performance, hyperparameter tuning, and other relevant metrics.
|
21 |
+
:::
|
documentation/docs/guide/experiments/compare-experiments.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/create-an-experiment.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: This page highlights the steps needed to create an experiment in H2O LLM Studio.
|
3 |
+
---
|
4 |
+
import Icon from "@material-ui/core/Icon";
|
5 |
+
|
6 |
+
# Create an experiment
|
7 |
+
|
8 |
+
Follow the relevant steps below to create an experiment in H2O LLM Studio.
|
9 |
+
|
10 |
+
1. On the H2O LLM Studio left-navigation pane, click **Create experiment**. Alternatively, you can click **New experiment** on the <Icon>more_vert</Icon> Kebab menu of the [View datasets](../datasets/view-dataset.md) page.
|
11 |
+
|
12 |
+
2. Select the **Dataset** you want to use to fine-tune an LLM model.
|
13 |
+
|
14 |
+
3. Select the **Problem type**.
|
15 |
+
|
16 |
+
4. Provide a meaningful **Experiment name**.
|
17 |
+
|
18 |
+
5. Define the parameters. The most important parameters are:
|
19 |
+
- **LLM Backbone**: This parameter determines the LLM architecture to use. It is the foundation model that you continue training. H2O LLM Studio has a predefined list of recommended foundation models available in the dropdown list. You can also type in the name of a [Hugging Face model](https://huggingface.co/models) that is not in the list, for example: `h2oai/h2o-danube2-1.8b-sft` or the path of a local folder that has the model you would like to fine-tune.
|
20 |
+
- **Mask Prompt Labels**: This option controls whether to mask the prompt labels during training and only train on the loss of the answer.
|
21 |
+
- Hyperparameters such as **Learning rate**, **Batch size**, and number of epochs determine the training process. You can refer to the tooltips that are shown next to each hyperparameter in the GUI to learn more about them.
|
22 |
+
- **Evaluate Before Training**: This option lets you evaluate the model before training, which can help you judge the quality of the LLM backbone before fine-tuning.
|
23 |
+
|
24 |
+
H2O LLM Studio provides several metric options for evaluating the performance of your model. In addition to the BLEU score, H2O LLM Studio also offers the GPT3.5 and GPT4 metrics that utilize the OpenAI API to determine whether the predicted answer is more favorable than the ground truth answer. To use these metrics, you can either export your OpenAI API key as an environment variable before starting LLM Studio, or you can specify it in the **Settings** menu within the UI.
|
25 |
+
|
26 |
+
:::info note
|
27 |
+
H2O LLM Studio provides an overview of all the parameters you need to specify for your experiment. The default settings are suitable when you first start an experiment. To learn more about the parameters, see [Experiment settings](experiment-settings.md).
|
28 |
+
:::
|
29 |
+
|
30 |
+
6. Click **Run experiment**.
|
31 |
+
|
32 |
+

|
33 |
+
|
34 |
+
## Run an experiment on the OASST data via CLI
|
35 |
+
|
36 |
+
The steps below provide an example of how to to run an experiment on [OASST](https://huggingface.co/OpenAssistant) data via the command line interface (CLI).
|
37 |
+
|
38 |
+
1. Get the training dataset (`train_full.csv`), [OpenAssistant Conversations Dataset OASST2](https://www.kaggle.com/code/philippsinger/openassistant-conversations-dataset-oasst2?scriptVersionId=160485459) and place it into the `examples/data_oasst2` folder; or download it directly using the [Kaggle API](https://www.kaggle.com/docs/api) command given below.
|
39 |
+
|
40 |
+
```bash
|
41 |
+
kaggle kernels output philippsinger/openassistant-conversations-dataset-oasst2 -p examples/data_oasst2/
|
42 |
+
```
|
43 |
+
|
44 |
+
2. Go into the interactive shell or open a new terminal window. Install the dependencies first, if you have not installed them already.
|
45 |
+
|
46 |
+
```bash
|
47 |
+
make setup # installs all dependencies
|
48 |
+
make shell
|
49 |
+
```
|
50 |
+
|
51 |
+
3. Run the following command to run the experiment.
|
52 |
+
|
53 |
+
```bash
|
54 |
+
python llm_studio/train.py -Y examples/example_oasst2.yaml
|
55 |
+
```
|
56 |
+
|
57 |
+
After the experiment is completed, you can find all output artifacts in the `examples/output_oasst2` folder.
|
58 |
+
You can then use the `prompt.py` script to chat with your model.
|
59 |
+
|
60 |
+
```bash
|
61 |
+
python llm_studio/prompt.py -e examples/output_oasst2
|
62 |
+
```
|
63 |
+
|
64 |
+
4. To publish the model to Hugging Face, use the following command:
|
65 |
+
|
66 |
+
```bash
|
67 |
+
python llm_studio/publish_to_hugging_face.py -p {path_to_experiment} -d {device} -a {api_key} -u {user_id} -m {model_name} -s {safe_serialization}
|
68 |
+
```
|
documentation/docs/guide/experiments/delete-experiment.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/evaluate-model-using-llm.md
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Evaluate model using an AI judge
|
2 |
+
|
3 |
+
H2O LLM Studio provides the option to use an AI Judge like ChatGPT or a local LLM deployment to evaluate a fine-tuned model.
|
4 |
+
|
5 |
+
Follow the instructions below to specify a local LLM to evaluate the responses of the fine-tuned model.
|
6 |
+
|
7 |
+
1. Have an endpoint running of the local LLM deployment, which supports the OpenAI API format; specifically the [Chat Completions API](https://platform.openai.com/docs/guides/text-generation/chat-completions-api).
|
8 |
+
|
9 |
+
2. Start the H2O LLM Studio server with the following environment variable that points to the endpoint.
|
10 |
+
```
|
11 |
+
OPENAI_API_BASE="http://111.111.111.111:8000/v1"
|
12 |
+
```
|
13 |
+
|
14 |
+
3. Once H2O LLM Studio is up and running, click **Settings** on the left navigation panel to validate that the endpoint is being used correctly. The **Use OpenAI API on Azure** setting must be set to Off, and the environment variable that was set above should be the **OpenAI API Endpoint** value as shown below.
|
15 |
+

|
16 |
+
|
17 |
+
:::info
|
18 |
+
Note that changing the value of this field here on the GUI has no effect. This is only for testing the correct setting of the environment variable.
|
19 |
+
:::
|
20 |
+
|
21 |
+
4. Run an experiment using `GPT` as the **Metric** and the relevant model name available at your endpoint as the **Metric Gpt Model**.
|
22 |
+

|
23 |
+
|
24 |
+
5. Validate that it is working as intended by checking the logs. Calls to the LLM judge should now be directed to your own LLM endpoint.
|
25 |
+

|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
|
documentation/docs/guide/experiments/experiment-settings.md
ADDED
@@ -0,0 +1,468 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: All the settings needed for creating an experiment are explored in this page.
|
3 |
+
---
|
4 |
+
import GeneralSettingsDataset from '../../tooltips/experiments/_dataset.mdx';
|
5 |
+
import GeneralSettingsProblemType from '../../tooltips/experiments/_problem-type.mdx';
|
6 |
+
import GSImportConfigFromYaml from '../../tooltips/experiments/_import-config-from-yaml.mdx';
|
7 |
+
import GSExperimentName from '../../tooltips/experiments/_experiment-name.mdx';
|
8 |
+
import GSLLMBackbone from '../../tooltips/experiments/_llm-backbone.mdx';
|
9 |
+
import DSTrainDataframe from '../../tooltips/experiments/_train-dataframe.mdx';
|
10 |
+
import DSvalidationStrategy from '../../tooltips/experiments/_validation-strategy.mdx';
|
11 |
+
import DSvalidationSize from '../../tooltips/experiments/_validation-size.mdx';
|
12 |
+
import DSdataSample from '../../tooltips/experiments/_data-sample.mdx';
|
13 |
+
import DSpromptColumn from '../../tooltips/experiments/_prompt-column.mdx';
|
14 |
+
import DSPromptColumnSeparator from '../../tooltips/experiments/_prompt-column-separator.mdx';
|
15 |
+
import DSsystemColumn from '../../tooltips/experiments/_system-column.mdx';
|
16 |
+
import DSanswerColumn from '../../tooltips/experiments/_answer-column.mdx';
|
17 |
+
import DSparentIdColumn from '../../tooltips/experiments/_parent-id-column.mdx';
|
18 |
+
import DStextPromptStart from '../../tooltips/experiments/_text-prompt-start.mdx';
|
19 |
+
import DStextAnswerSeparator from '../../tooltips/experiments/_text-answer-separator.mdx';
|
20 |
+
import DSaddEosTokentoprompt from '../../tooltips/experiments/_add-eos-token-to-prompt.mdx';
|
21 |
+
import DSaddEosTokentoanswer from '../../tooltips/experiments/_add-eos-token-to-answer.mdx';
|
22 |
+
import DSmaskPromptlabels from '../../tooltips/experiments/_mask-prompt-labels.mdx';
|
23 |
+
import TSmaxLength from '../../tooltips/experiments/_max-length.mdx';
|
24 |
+
import TSaddpromptanswertokens from '../../tooltips/experiments/_add-prompt-answer-tokens.mdx';
|
25 |
+
import TSpaddingQuantile from '../../tooltips/experiments/_padding-quantile.mdx';
|
26 |
+
import ASBackboneDtype from '../../tooltips/experiments/_backbone-dtype.mdx';
|
27 |
+
import ASGradientcheckpointing from '../../tooltips/experiments/_gradient-checkpointing.mdx';
|
28 |
+
import ASintermediateDropout from '../../tooltips/experiments/_intermediate-dropout.mdx';
|
29 |
+
import ASpretrainedWeights from '../../tooltips/experiments/_pretrained-weights.mdx';
|
30 |
+
import TSoptimizer from '../../tooltips/experiments/_optimizer.mdx';
|
31 |
+
import TSlossfunction from '../../tooltips/experiments/_loss-function.mdx';
|
32 |
+
import TSlearningRate from '../../tooltips/experiments/_learning-rate.mdx';
|
33 |
+
import TSdifferentialLearningRateLayers from '../../tooltips/experiments/_differential-learning-rate-layers.mdx';
|
34 |
+
import TSfreezeLayers from '../../tooltips/experiments/_freeze-layers.mdx';
|
35 |
+
import TSattentionImplementation from '../../tooltips/experiments/_attention-implementation.mdx';
|
36 |
+
import TSbatchSize from '../../tooltips/experiments/_batch-size.mdx';
|
37 |
+
import TSepochs from '../../tooltips/experiments/_epochs.mdx';
|
38 |
+
import TSschedule from '../../tooltips/experiments/_schedule.mdx';
|
39 |
+
import TSminLearningRateRatio from '../../tooltips/experiments/_min-learning-rate-ratio.mdx';
|
40 |
+
import TSwarmupEpochs from '../../tooltips/experiments/_warmup-epochs.mdx';
|
41 |
+
import TSweightDecay from '../../tooltips/experiments/_weight-decay.mdx';
|
42 |
+
import TSGradientclip from '../../tooltips/experiments/_gradient-clip.mdx';
|
43 |
+
import TSgradAccumulation from '../../tooltips/experiments/_grad-accumulation.mdx';
|
44 |
+
import TSlora from '../../tooltips/experiments/_lora.mdx';
|
45 |
+
import TSuseDora from '../../tooltips/experiments/_use-dora.mdx';
|
46 |
+
import TSloraR from '../../tooltips/experiments/_lora-r.mdx';
|
47 |
+
import TSloraAlpha from '../../tooltips/experiments/_lora-alpha.mdx';
|
48 |
+
import TSloraDropout from '../../tooltips/experiments/_lora-dropout.mdx';
|
49 |
+
import TSuseRSlora from '../../tooltips/experiments/_use-rslora.mdx';
|
50 |
+
import TSloraTargetModules from '../../tooltips/experiments/_lora-target-modules.mdx';
|
51 |
+
import TSloraUnfreezeLayers from '../../tooltips/experiments/_lora-unfreeze-layers.mdx';
|
52 |
+
import TSsavecheckpoint from '../../tooltips/experiments/_save-checkpoint.mdx';
|
53 |
+
import TSevaluationepochs from '../../tooltips/experiments/_evaluation-epochs.mdx';
|
54 |
+
import TSevaluationbeforetraining from '../../tooltips/experiments/_evaluate-before-training.mdx';
|
55 |
+
import TStrainvalidationdata from '../../tooltips/experiments/_train-validation-data.mdx';
|
56 |
+
import AStokenmaskprobability from '../../tooltips/experiments/_token-mask-probability.mdx';
|
57 |
+
import ASskipParentprobability from '../../tooltips/experiments/_skip-parent-probability.mdx';
|
58 |
+
import ASrandomparentprobability from '../../tooltips/experiments/_random-parent-probability.mdx';
|
59 |
+
import ASneftunenoisealpha from '../../tooltips/experiments/_neftune_noise_alpha.mdx';
|
60 |
+
import PSmetric from '../../tooltips/experiments/_metric.mdx';
|
61 |
+
import PSmetricgptmodel from '../../tooltips/experiments/_metric-gpt-model.mdx';
|
62 |
+
import PSmetricgpttemplate from '../../tooltips/experiments/_metric-gpt-template.mdx';
|
63 |
+
import PSminlengthinference from '../../tooltips/experiments/_min-length-inference.mdx';
|
64 |
+
import PSmaxlengthinference from '../../tooltips/experiments/_max-length-inference.mdx';
|
65 |
+
import PSbatchsizeinference from '../../tooltips/experiments/_batch-size-inference.mdx';
|
66 |
+
import PSdosample from '../../tooltips/experiments/_do-sample.mdx';
|
67 |
+
import PSnumbeams from '../../tooltips/experiments/_num-beams.mdx';
|
68 |
+
import PStemperature from '../../tooltips/experiments/_temperature.mdx';
|
69 |
+
import PSrepetitionpenalty from '../../tooltips/experiments/_repetition-penalty.mdx';
|
70 |
+
import PSstoptokens from '../../tooltips/experiments/_stop-tokens.mdx';
|
71 |
+
import PStopk from '../../tooltips/experiments/_top-k.mdx';
|
72 |
+
import PStopp from '../../tooltips/experiments/_top-p.mdx';
|
73 |
+
import ESgpus from '../../tooltips/experiments/_gpus.mdx';
|
74 |
+
import ESmixedprecision from '../../tooltips/experiments/_mixed-precision.mdx';
|
75 |
+
import EScompilemodel from '../../tooltips/experiments/_compile-model.mdx';
|
76 |
+
import ESfindunusedparameters from '../../tooltips/experiments/_find-unused-parameters.mdx';
|
77 |
+
import EStrustremotecode from '../../tooltips/experiments/_trust-remote-code.mdx';
|
78 |
+
import EShuggingfacebranch from '../../tooltips/experiments/_huggingface-branch.mdx';
|
79 |
+
import ESnumofworkers from '../../tooltips/experiments/_number-of-workers.mdx';
|
80 |
+
import ESseed from '../../tooltips/experiments/_seed.mdx';
|
81 |
+
import LSlogstepsize from '../../tooltips/experiments/_log-step-size.mdx';
|
82 |
+
import LSlogallranks from '../../tooltips/experiments/_log-all-ranks.mdx';
|
83 |
+
import LSlogger from '../../tooltips/experiments/_logger.mdx';
|
84 |
+
import LSneptuneproject from '../../tooltips/experiments/_neptune-project.mdx';
|
85 |
+
import LSwandbproject from '../../tooltips/experiments/_wandb-project.mdx';
|
86 |
+
import LSwandbentity from '../../tooltips/experiments/_wandb-entity.mdx';
|
87 |
+
import NumClasses from '../../tooltips/experiments/_num-classes.mdx';
|
88 |
+
|
89 |
+
# Experiment settings
|
90 |
+
|
91 |
+
The settings for creating an experiment are grouped into the following sections:
|
92 |
+
- [General settings](#general-settings)
|
93 |
+
- [Dataset settings](#dataset-settings)
|
94 |
+
- [Tokenizer settings](#tokenizer-settings)
|
95 |
+
- [Architecture settings](#architecture-settings)
|
96 |
+
- [Training settings](#training-settings)
|
97 |
+
- [Augmentation settings](#augmentation-settings)
|
98 |
+
- [Prediction settings](#prediction-settings)
|
99 |
+
- [Environment settings](#environment-settings)
|
100 |
+
- [Logging settings](#logging-settings)
|
101 |
+
|
102 |
+
The settings under each category are listed and described below.
|
103 |
+
|
104 |
+
## General settings
|
105 |
+
|
106 |
+
### Dataset
|
107 |
+
|
108 |
+
<GeneralSettingsDataset/>
|
109 |
+
|
110 |
+
### Problem type
|
111 |
+
|
112 |
+
<GeneralSettingsProblemType/>
|
113 |
+
|
114 |
+
### Import config from YAML
|
115 |
+
|
116 |
+
<GSImportConfigFromYaml/>
|
117 |
+
|
118 |
+
### Experiment name
|
119 |
+
|
120 |
+
<GSExperimentName/>
|
121 |
+
|
122 |
+
### LLM backbone
|
123 |
+
|
124 |
+
<GSLLMBackbone/>
|
125 |
+
|
126 |
+
## Dataset settings
|
127 |
+
|
128 |
+
### Train dataframe
|
129 |
+
|
130 |
+
<DSTrainDataframe/>
|
131 |
+
|
132 |
+
### Validation strategy
|
133 |
+
|
134 |
+
<DSvalidationStrategy/>
|
135 |
+
|
136 |
+
### Validation size
|
137 |
+
|
138 |
+
<DSvalidationSize/>
|
139 |
+
|
140 |
+
### Data sample
|
141 |
+
|
142 |
+
<DSdataSample/>
|
143 |
+
|
144 |
+
### System column
|
145 |
+
|
146 |
+
<DSsystemColumn/>
|
147 |
+
|
148 |
+
### Prompt column
|
149 |
+
|
150 |
+
<DSpromptColumn/>
|
151 |
+
|
152 |
+
### Prompt column separator
|
153 |
+
|
154 |
+
<DSPromptColumnSeparator/>
|
155 |
+
|
156 |
+
### Answer column
|
157 |
+
|
158 |
+
<DSanswerColumn/>
|
159 |
+
|
160 |
+
### Parent ID column
|
161 |
+
|
162 |
+
<DSparentIdColumn/>
|
163 |
+
|
164 |
+
### ID column
|
165 |
+
|
166 |
+
<DSidColumn/>
|
167 |
+
|
168 |
+
### Text prompt start
|
169 |
+
|
170 |
+
<DStextPromptStart/>
|
171 |
+
|
172 |
+
### Text answer separator
|
173 |
+
|
174 |
+
<DStextAnswerSeparator/>
|
175 |
+
|
176 |
+
### Add EOS token to prompt
|
177 |
+
|
178 |
+
<DSaddEosTokentoprompt/>
|
179 |
+
|
180 |
+
### Add EOS token to answer
|
181 |
+
|
182 |
+
<DSaddEosTokentoanswer/>
|
183 |
+
|
184 |
+
### Mask prompt labels
|
185 |
+
|
186 |
+
<DSmaskPromptlabels/>
|
187 |
+
|
188 |
+
### Num classes
|
189 |
+
|
190 |
+
<NumClasses/>
|
191 |
+
|
192 |
+
The **Num classes** field should be set to the total number of classes in the [answer column](../datasets/import-dataset.md#answer-column) of the dataset.
|
193 |
+
|
194 |
+
## Tokenizer settings
|
195 |
+
|
196 |
+
### Max length
|
197 |
+
|
198 |
+
<TSmaxLength/>
|
199 |
+
|
200 |
+
### Add prompt answer tokens
|
201 |
+
|
202 |
+
<TSaddpromptanswertokens/>
|
203 |
+
|
204 |
+
### Padding quantile
|
205 |
+
|
206 |
+
<TSpaddingQuantile/>
|
207 |
+
|
208 |
+
## Architecture settings
|
209 |
+
|
210 |
+
### Backbone Dtype
|
211 |
+
|
212 |
+
<ASBackboneDtype/>
|
213 |
+
|
214 |
+
### Gradient Checkpointing
|
215 |
+
|
216 |
+
<ASGradientcheckpointing/>
|
217 |
+
|
218 |
+
### Intermediate dropout
|
219 |
+
|
220 |
+
<ASintermediateDropout/>
|
221 |
+
|
222 |
+
### Pretrained weights
|
223 |
+
|
224 |
+
<ASpretrainedWeights/>
|
225 |
+
|
226 |
+
## Training settings
|
227 |
+
|
228 |
+
### Loss function
|
229 |
+
|
230 |
+
<TSlossfunction/>
|
231 |
+
|
232 |
+
For multiclass classification problems, set the loss function to **Cross-entropy**.
|
233 |
+
|
234 |
+
### Optimizer
|
235 |
+
|
236 |
+
<TSoptimizer/>
|
237 |
+
|
238 |
+
### Learning rate
|
239 |
+
|
240 |
+
<TSlearningRate/>
|
241 |
+
|
242 |
+
### Differential learning rate layers
|
243 |
+
|
244 |
+
<TSdifferentialLearningRateLayers/>
|
245 |
+
|
246 |
+
By default, H2O LLM Studio applies **Differential learning rate Layers**, with the learning rate for the `classification_head` being 10 times smaller than the learning rate for the rest of the model.
|
247 |
+
|
248 |
+
### Freeze layers
|
249 |
+
|
250 |
+
<TSfreezeLayers/>
|
251 |
+
|
252 |
+
### Attention Implementation
|
253 |
+
|
254 |
+
<TSattentionImplementation/>
|
255 |
+
|
256 |
+
### Batch size
|
257 |
+
|
258 |
+
<TSbatchSize/>
|
259 |
+
|
260 |
+
### Epochs
|
261 |
+
|
262 |
+
<TSepochs/>
|
263 |
+
|
264 |
+
### Schedule
|
265 |
+
|
266 |
+
<TSschedule/>
|
267 |
+
|
268 |
+
### Min Learning Rate Ratio
|
269 |
+
|
270 |
+
<TSminLearningRateRatio/>
|
271 |
+
|
272 |
+
### Warmup epochs
|
273 |
+
|
274 |
+
<TSwarmupEpochs/>
|
275 |
+
|
276 |
+
### Weight decay
|
277 |
+
|
278 |
+
<TSweightDecay/>
|
279 |
+
|
280 |
+
### Gradient clip
|
281 |
+
|
282 |
+
<TSGradientclip/>
|
283 |
+
|
284 |
+
### Grad accumulation
|
285 |
+
|
286 |
+
<TSgradAccumulation/>
|
287 |
+
|
288 |
+
### Lora
|
289 |
+
|
290 |
+
<TSlora/>
|
291 |
+
|
292 |
+
### Use Dora
|
293 |
+
|
294 |
+
<TSuseDora/>
|
295 |
+
|
296 |
+
### Lora R
|
297 |
+
|
298 |
+
<TSloraR/>
|
299 |
+
|
300 |
+
### Lora Alpha
|
301 |
+
|
302 |
+
<TSloraAlpha/>
|
303 |
+
|
304 |
+
### Lora dropout
|
305 |
+
|
306 |
+
<TSloraDropout/>
|
307 |
+
|
308 |
+
### Use RS Lora
|
309 |
+
|
310 |
+
<TSuseRSlora/>
|
311 |
+
|
312 |
+
### Lora target modules
|
313 |
+
|
314 |
+
<TSloraTargetModules/>
|
315 |
+
|
316 |
+
### Lora unfreeze layers
|
317 |
+
|
318 |
+
<TSloraUnfreezeLayers/>
|
319 |
+
|
320 |
+
### Save checkpoint
|
321 |
+
|
322 |
+
<TSsavecheckpoint/>
|
323 |
+
|
324 |
+
### Evaluation epochs
|
325 |
+
|
326 |
+
<TSevaluationepochs/>
|
327 |
+
|
328 |
+
### Evaluate before training
|
329 |
+
|
330 |
+
<TSevaluationbeforetraining/>
|
331 |
+
|
332 |
+
### Train validation data
|
333 |
+
|
334 |
+
<TStrainvalidationdata/>
|
335 |
+
|
336 |
+
## Augmentation settings
|
337 |
+
|
338 |
+
### Token mask probability
|
339 |
+
|
340 |
+
<AStokenmaskprobability/>
|
341 |
+
|
342 |
+
### Skip parent probability
|
343 |
+
|
344 |
+
<ASskipParentprobability/>
|
345 |
+
|
346 |
+
### Random parent probability
|
347 |
+
|
348 |
+
<ASrandomparentprobability/>
|
349 |
+
|
350 |
+
### Neftune noise alpha
|
351 |
+
|
352 |
+
<ASneftunenoisealpha/>
|
353 |
+
|
354 |
+
## Prediction settings
|
355 |
+
|
356 |
+
### Metric
|
357 |
+
|
358 |
+
<PSmetric/>
|
359 |
+
|
360 |
+
### Metric GPT model
|
361 |
+
|
362 |
+
<PSmetricgptmodel/>
|
363 |
+
|
364 |
+
### Metric GPT template
|
365 |
+
|
366 |
+
<PSmetricgpttemplate/>
|
367 |
+
|
368 |
+
### Min length inference
|
369 |
+
|
370 |
+
<PSminlengthinference/>
|
371 |
+
|
372 |
+
### Max length inference
|
373 |
+
|
374 |
+
<PSmaxlengthinference/>
|
375 |
+
|
376 |
+
### Batch size inference
|
377 |
+
|
378 |
+
<PSbatchsizeinference/>
|
379 |
+
|
380 |
+
### Do sample
|
381 |
+
|
382 |
+
<PSdosample/>
|
383 |
+
|
384 |
+
### Num beams
|
385 |
+
|
386 |
+
<PSnumbeams/>
|
387 |
+
|
388 |
+
### Temperature
|
389 |
+
|
390 |
+
<PStemperature/>
|
391 |
+
|
392 |
+
### Repetition penalty
|
393 |
+
|
394 |
+
<PSrepetitionpenalty/>
|
395 |
+
|
396 |
+
### Stop tokens
|
397 |
+
|
398 |
+
<PSstoptokens/>
|
399 |
+
|
400 |
+
### Top K
|
401 |
+
|
402 |
+
<PStopk/>
|
403 |
+
|
404 |
+
### Top P
|
405 |
+
|
406 |
+
<PStopp/>
|
407 |
+
|
408 |
+
## Environment settings
|
409 |
+
|
410 |
+
### GPUs
|
411 |
+
|
412 |
+
<ESgpus/>
|
413 |
+
|
414 |
+
### Mixed precision
|
415 |
+
|
416 |
+
<ESmixedprecision/>
|
417 |
+
|
418 |
+
### Compile model
|
419 |
+
|
420 |
+
<EScompilemodel/>
|
421 |
+
|
422 |
+
### Find unused parameters
|
423 |
+
|
424 |
+
<ESfindunusedparameters/>
|
425 |
+
|
426 |
+
### Trust remote code
|
427 |
+
|
428 |
+
<EStrustremotecode/>
|
429 |
+
|
430 |
+
### Hugging Face branch
|
431 |
+
|
432 |
+
<EShuggingfacebranch/>
|
433 |
+
|
434 |
+
### Number of workers
|
435 |
+
|
436 |
+
<ESnumofworkers/>
|
437 |
+
|
438 |
+
### Seed
|
439 |
+
|
440 |
+
<ESseed/>
|
441 |
+
|
442 |
+
## Logging settings
|
443 |
+
|
444 |
+
### Log step size
|
445 |
+
|
446 |
+
<LSlogstepsize/>
|
447 |
+
|
448 |
+
### Log all ranks
|
449 |
+
|
450 |
+
<LSlogallranks/>
|
451 |
+
|
452 |
+
### Logger
|
453 |
+
|
454 |
+
<LSlogger/>
|
455 |
+
|
456 |
+
### Neptune project
|
457 |
+
|
458 |
+
<LSneptuneproject/>
|
459 |
+
|
460 |
+
### W&B project
|
461 |
+
|
462 |
+
<LSwandbproject/>
|
463 |
+
|
464 |
+
### W&B entity
|
465 |
+
|
466 |
+
<LSwandbentity/>
|
467 |
+
|
468 |
+
|
documentation/docs/guide/experiments/export-model-to-huggingface.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/export-trained-model.md
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: If you are ready to share your trained model with a broader community, H2O LLM Studio allows you to export the fine-tuned model to Hugging Face Hub with a single click.
|
3 |
+
---
|
4 |
+
# Publish model to HuggingFace
|
5 |
+
|
6 |
+
If you are ready to share your trained model with a broader community, H2O LLM Studio allows you to export the fine-tuned model to [Hugging Face](https://huggingface.co/) with a single click.
|
7 |
+
|
8 |
+
:::info note
|
9 |
+
Before publishing your model to the Hugging Face Hub, you need to have an API key with write access. To obtain an API token with write access, follow the [instructions provided by Hugging Face](https://huggingface.co/docs/hub/security-tokens), which involve creating an account, logging in, and generating an access token with the appropriate permission.
|
10 |
+
:::
|
11 |
+
|
12 |
+
To publish a trained model to Hugging Face Hub:
|
13 |
+
|
14 |
+
1. On the H2O LLM Studio left-navigation pane, click **View experiments**. You will see the experiments table with a list of all the experiments you have launched so far.
|
15 |
+
|
16 |
+
2. Click the name of the experiment that you want to export as a model.
|
17 |
+
|
18 |
+
3. Click **Push checkpoint to huggingface**.
|
19 |
+
|
20 |
+
4. Enter the **Account name** on Hugging Face to push the model to a particular account. Leaving it empty will push it to the default user account.
|
21 |
+
|
22 |
+
5. Enter the **Hugging Face API** Key with write access.
|
23 |
+
|
24 |
+
6. Click **Export**.
|
25 |
+
|
26 |
+

|
27 |
+
|
28 |
+
## Download a model
|
29 |
+
|
30 |
+
Click **Download model** on the **View experiments** page to download the model locally.
|
31 |
+
|
32 |
+
Use the following code snippet to utilize the converted model in Jupyter Notebook or Google Colab.
|
33 |
+
|
34 |
+
```python
|
35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
+
|
37 |
+
model_name = "path_to_downloaded_model" # either local folder or Hugging Face model name
|
38 |
+
|
39 |
+
# Important: The prompt needs to be in the same format the model was trained with.
|
40 |
+
# You can find an example prompt in the experiment logs.
|
41 |
+
prompt = "<|prompt|>How are you?<|endoftext|><|answer|>"
|
42 |
+
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
44 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
45 |
+
model.cuda().eval()
|
46 |
+
|
47 |
+
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
|
48 |
+
# generate configuration can be modified to your needs
|
49 |
+
tokens = model.generate(
|
50 |
+
**inputs, # Input any question for the model. Ex: "What is the capital of USA?"
|
51 |
+
max_new_tokens=256,
|
52 |
+
temperature=0.3,
|
53 |
+
repetition_penalty=1.2,
|
54 |
+
num_beams=1
|
55 |
+
)[0]
|
56 |
+
tokens = tokens[inputs["input_ids"].shape[1]:]
|
57 |
+
answer = tokenizer.decode(tokens, skip_special_tokens=True)
|
58 |
+
print(answer)
|
59 |
+
```
|
60 |
+
|
61 |
+
You can enter any question for the model and change the parameters to get different outputs.
|
documentation/docs/guide/experiments/import-to-h2ogpt.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: Once the model has been fine-tuned using H2O LLM Studio, you can then use h2oGPT to query, summarize, and chat with your model.
|
3 |
+
---
|
4 |
+
import Tabs from '@theme/Tabs';
|
5 |
+
import TabItem from '@theme/TabItem';
|
6 |
+
|
7 |
+
# Import a model to h2oGPT
|
8 |
+
|
9 |
+
Once the model has been fine-tuned using H2O LLM Studio, you can then use [h2oGPT](https://github.com/h2oai/h2ogpt/blob/main/README.md) to query, summarize, and chat with your model.
|
10 |
+
|
11 |
+
The most common method to get the model from H2O LLM Studio over to h2oGPT, is to import it into h2oGPT via HuggingFace. However, if your data is sensitive, you can also choose to download the model locally to your machine, and then import it directly into h2oGPT.
|
12 |
+
|
13 |
+
You can use any of the following methods:
|
14 |
+
|
15 |
+
- Publish the model to HuggingFace and import the model from HuggingFace
|
16 |
+
- Download the model and import it to h2oGPT by specifying the local folder path
|
17 |
+
- Download the model and upload it to h2oGPT using the file upload option on the UI
|
18 |
+
- Pull a model from a Github repository or a resolved web link
|
19 |
+
|
20 |
+
## Steps
|
21 |
+
|
22 |
+
1. [Publish the model to HuggingFace](export-trained-model.md) or [download the model locally](export-trained-model.md#download-a-model).
|
23 |
+
|
24 |
+
2. If you opt to download the model, make sure you extract the downloaded .zip file.
|
25 |
+
|
26 |
+
3. Use the following command to import it into h2oGPT.
|
27 |
+
```
|
28 |
+
python generate.py --base_model=[link_or_path_to_folder]
|
29 |
+
```
|
30 |
+
|
31 |
+
:::note Examples
|
32 |
+
<Tabs className="unique-tabs">
|
33 |
+
<TabItem value="Example1" label="From HuggingFace">
|
34 |
+
<pre><code>python generate.py --base_model=HuggingFaceH4/zephyr-7b-beta</code></pre>
|
35 |
+
</TabItem>
|
36 |
+
<TabItem value="Example2" label="From a Local File">
|
37 |
+
<pre><code>python generate.py --base_model=zephyr-7b-beta.Q5_K_M.gguf</code></pre>
|
38 |
+
</TabItem>
|
39 |
+
<TabItem value="Example3" label="From a Repository">
|
40 |
+
<pre><code>python generate.py --base_model=TheBloke/zephyr-7B-beta-AWQ</code></pre>
|
41 |
+
</TabItem>
|
42 |
+
</Tabs>
|
43 |
+
:::
|
44 |
+
|
45 |
+
:::info
|
46 |
+
For more information, see the [h2oGPT documentation](https://github.com/h2oai/h2ogpt/blob/main/docs/FAQ.md#adding-models).
|
47 |
+
:::
|
48 |
+
|
documentation/docs/guide/experiments/local-llm-judge-logs.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/run-experiment.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/set-endpoint.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/set-metric-model.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/stop-experiment.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/supported-problem-types.md
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Supported problem types
|
2 |
+
|
3 |
+
## Overview
|
4 |
+
|
5 |
+
H2O LLM Studio supports various problem types that allow users to fine-tune models for different tasks. The five supported problem types are explained below.
|
6 |
+
|
7 |
+
## Causal language modeling
|
8 |
+
|
9 |
+
- **Description:** Causal language modeling involves predicting the next token in a sequence, based only on the preceding tokens (i.e., the left side of the sequence). It is commonly used for tasks such as text generation. It is used to fine-tune large language models.
|
10 |
+
|
11 |
+
## Causal classification modeling
|
12 |
+
|
13 |
+
- **Description:** Causal classification modeling involves assigning one or more categorical target labels to an input text. It is used for fine-tuning models to perform text classification tasks.
|
14 |
+
|
15 |
+
- **Supported classification tasks:** Binary, multi-class, and multi-label classification.
|
16 |
+
|
17 |
+
## Causal regression modeling
|
18 |
+
|
19 |
+
- **Description:** Causal regression modeling assigns one or more continuous target labels to an input text. It is used to fine-tune models for text regression tasks.
|
20 |
+
|
21 |
+
- **Supported regression tasks:** Multi-label regression.
|
22 |
+
|
23 |
+
## Sequence to sequence modeling
|
24 |
+
|
25 |
+
- **Description:** A type of machine learning architecture designed to transform one sequence into another. It is commonly used for tasks like machine translation, text summarization, and speech recognition.
|
26 |
+
|
27 |
+
## DPO modeling
|
28 |
+
|
29 |
+
- **Description:** The DPO modeling is used to fine-tune large language models using Direct Preference Optimization (DPO), a method that helps large, unsupervised language models better match human preferences using a simple classification approach.
|
30 |
+
|
documentation/docs/guide/experiments/view-an-experiment.md
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: You can view, rename, stop, or delete your experiments once you launch them. You can also create a new experiment based on an experiment you have already launched.
|
3 |
+
---
|
4 |
+
import Icon from "@material-ui/core/Icon";
|
5 |
+
|
6 |
+
# View and manage experiments
|
7 |
+
|
8 |
+
You can view, rename, stop, or delete your experiments once you launch them. You can also create a new experiment based on an experiment you have already launched.
|
9 |
+
|
10 |
+
## View an experiment
|
11 |
+
|
12 |
+
To view an experiment:
|
13 |
+
|
14 |
+
1. On the H2O LLM Studio left-navigation pane, click **View experiments**.
|
15 |
+
|
16 |
+
2. You will see the experiments table with a list of all the experiments you have launched so far. Click the name of the experiment that you want to view.
|
17 |
+
|
18 |
+

|
19 |
+
|
20 |
+
## Experiment tabs
|
21 |
+
|
22 |
+
Once you click the name of the experiment, you will see the following tabs that provide details and different aspects of your experiment.
|
23 |
+
|
24 |
+
- **Charts** : This tab visually represents the train/validation loss, metrics, and learning rate. These charts allow you to easily track your model’s performance as it trains.
|
25 |
+
|
26 |
+

|
27 |
+
|
28 |
+
- **Summary** : This tab contains the following details about an experiment.
|
29 |
+
|
30 |
+
| Name | Description |
|
31 |
+
| ----------- | ------------------------------------ |
|
32 |
+
| **Name** | Name of the experiment. |
|
33 |
+
| **Dataset** | Name of the dataset. |
|
34 |
+
| **Problem type** | The problem type of the experiment. |
|
35 |
+
| **Seed** | The random seed value that H2O LLM Studio uses during model training. |
|
36 |
+
| **GPU list** | The list of GPUs H2O LLM Studio can use for the experiment. |
|
37 |
+
| **Loss** | The loss function. |
|
38 |
+
| **Metric** | The metric to evaluate the model’s performance. |
|
39 |
+
| **Val metric** | The measure of how well the experiment was performed. |
|
40 |
+
|
41 |
+
- **Train data insights** : This tab displays the model’s first batch, so you can verify that the input data representation is correct. Also, it provides insight into how your data is being processed and can help identify potential issues early on in the experiment.
|
42 |
+
|
43 |
+
- **Validation prediction insights** : This tab displays model predictions for random, best, and worst validation samples. This tab becomes available after the first validation run and allows you to evaluate how well your model generalizes to new data.
|
44 |
+
|
45 |
+

|
46 |
+
|
47 |
+

|
48 |
+
|
49 |
+
The **Worst validation samples** give you an idea of where the model is having issues, and the model can be used to fine-tune further.
|
50 |
+
|
51 |
+
- **Logs and Config tabs** : These two tabs show you the logs and configuration of the experiment. You can keep track of any changes made and quickly troubleshoot the issues that arise.
|
52 |
+
|
53 |
+
- **Chat** : This tab provides a unique opportunity to interact with your trained model and get instant feedback on its performance. The **Chat** tab becomes available after the training is completed and can be used to evaluate how well your model performs in a conversational setting.
|
54 |
+
|
55 |
+
:::info note
|
56 |
+
You can use the **Chat** feature only when there are no other experiments running. The chatbot is unavailable if the GPU is occupied by another experiment.
|
57 |
+
:::
|
58 |
+
|
59 |
+

|
60 |
+
|
61 |
+
## Stop an experiment
|
62 |
+
|
63 |
+
You can stop a running experiment if you no longer need it to be completed.
|
64 |
+
|
65 |
+
1. On the H2O LLM Studio left-navigation pane, click **View experiments**.
|
66 |
+
2. Click **Stop experiments**.
|
67 |
+
3. Select the experiment(s) that you want to stop.
|
68 |
+
4. Click **Stop experiments**.
|
69 |
+
|
70 |
+
You can also click **Stop experiment** on the <Icon>more_vert</Icon> Kebab menu of the relevant experiment row to stop an experiment from running.
|
71 |
+
|
72 |
+

|
73 |
+
|
74 |
+
## Delete an experiment
|
75 |
+
|
76 |
+
When an experiment is no longer needed, you can delete it. Deleted experiments are permanently removed from the H2O LLM Studio instance.
|
77 |
+
|
78 |
+
1. On the H2O LLM Studio left-navigation pane, click **View experiments**.
|
79 |
+
2. Click **Delete experiments**.
|
80 |
+
3. Select the experiment(s) that you want to delete and click **Delete experiments**.
|
81 |
+
4. Click **Delete** to confirm deletion.
|
82 |
+
|
83 |
+
You can also click **Delete experiment** in the kebab menu of the relevant experiment row to delete an experiment.
|
84 |
+
|
85 |
+

|
documentation/docs/guide/experiments/view-experiments.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/guide/experiments/worst-validation-sample.png
ADDED
![]() |
Git LFS Details
|
documentation/docs/index.md
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
slug: /
|
3 |
+
displayed_sidebar: defaultSidebar
|
4 |
+
title: H2O LLM Studio | Docs
|
5 |
+
hide_table_of_contents: true
|
6 |
+
hide_title: true
|
7 |
+
description: 'A framework and no-code GUI designed for fine-tuning state-of-the-art large language models (LLMs)'
|
8 |
+
---
|
9 |
+
|
10 |
+
import H2OHome from '@site/src/components/H2OHome';
|
11 |
+
|
12 |
+
<H2OHome title="H2O LLM Studio" description="A framework and no-code GUI designed for fine-tuning state-of-the-art large language models (LLMs)" sections={[
|
13 |
+
{
|
14 |
+
subsections: [
|
15 |
+
{
|
16 |
+
title: "Get started",
|
17 |
+
icon: "rocket_launch",
|
18 |
+
items: [
|
19 |
+
{
|
20 |
+
label: "What is H2O LLM Studio?",
|
21 |
+
to: "/get-started/what-is-h2o-llm-studio",
|
22 |
+
},
|
23 |
+
{
|
24 |
+
label: "Set up H2O LLM Studio",
|
25 |
+
to: "/get-started/set-up-llm-studio",
|
26 |
+
},
|
27 |
+
{
|
28 |
+
label: "Core features",
|
29 |
+
to: "/get-started/core-features",
|
30 |
+
},
|
31 |
+
{
|
32 |
+
label: "Model flow",
|
33 |
+
to: "/get-started/llm-studio-flow",
|
34 |
+
},
|
35 |
+
],
|
36 |
+
},
|
37 |
+
{
|
38 |
+
title: "Datasets",
|
39 |
+
icon: "dataset",
|
40 |
+
subtitle: null,
|
41 |
+
items: [
|
42 |
+
{
|
43 |
+
label: "Data connectors and data format",
|
44 |
+
to: "/guide/datasets/data-connectors-format",
|
45 |
+
},
|
46 |
+
{
|
47 |
+
label: "Import a dataset",
|
48 |
+
to: "/guide/datasets/import-dataset",
|
49 |
+
},
|
50 |
+
{
|
51 |
+
label: "View and manage a dataset",
|
52 |
+
to: "/guide/datasets/view-dataset",
|
53 |
+
},
|
54 |
+
{
|
55 |
+
label: "Merge datasets",
|
56 |
+
to: "/guide/datasets/merge-datasets",
|
57 |
+
},
|
58 |
+
],
|
59 |
+
},
|
60 |
+
{
|
61 |
+
title: "Experiments",
|
62 |
+
icon: "timeline",
|
63 |
+
items: [
|
64 |
+
{
|
65 |
+
label: "Experiment settings",
|
66 |
+
to: "/guide/experiments/experiment-settings",
|
67 |
+
},
|
68 |
+
{
|
69 |
+
label: "Create an experiment",
|
70 |
+
to: "/guide/experiments/create-an-experiment",
|
71 |
+
},
|
72 |
+
{
|
73 |
+
label: "Monitor experiments",
|
74 |
+
to: "/guide/experiments/view-an-experiment",
|
75 |
+
},
|
76 |
+
{
|
77 |
+
label: "Compare experiments",
|
78 |
+
to: "/guide/experiments/compare-experiments",
|
79 |
+
},
|
80 |
+
{
|
81 |
+
label: "Publish model",
|
82 |
+
to: "/guide/experiments/export-trained-model",
|
83 |
+
},
|
84 |
+
],
|
85 |
+
},
|
86 |
+
{
|
87 |
+
title: "Helpful links",
|
88 |
+
icon: "link",
|
89 |
+
items: [
|
90 |
+
{
|
91 |
+
label: "FAQs",
|
92 |
+
to: "/faqs",
|
93 |
+
},
|
94 |
+
{
|
95 |
+
label: "Concepts",
|
96 |
+
to: "/concepts",
|
97 |
+
},
|
98 |
+
{
|
99 |
+
label: "Videos",
|
100 |
+
to: "/get-started/videos",
|
101 |
+
},
|
102 |
+
{
|
103 |
+
label: "Key Terms",
|
104 |
+
to: "/key-terms",
|
105 |
+
},
|
106 |
+
],
|
107 |
+
},
|
108 |
+
],
|
109 |
+
},
|
110 |
+
]} />
|
documentation/docs/key-terms.md
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
description: H2O LLM Studio uses several key terms across its documentation.
|
3 |
+
---
|
4 |
+
# Key terms
|
5 |
+
|
6 |
+
H2O LLM Studio uses several key terms across its documentation, and each, in turn, is explained in the sections below.
|
7 |
+
|
8 |
+
## Prompt Engineering
|
9 |
+
|
10 |
+
Prompt engineering involves crafting precise and effective input queries to guide language models in generating desired outputs or responses.
|
11 |
+
|
12 |
+
## Agents
|
13 |
+
|
14 |
+
Software entities or components that interact with data or perform tasks within a system.
|
15 |
+
|
16 |
+
## ELO
|
17 |
+
|
18 |
+
An algorithm or method used to assess and rank the performance or accuracy of language models based on their proficiency in understanding and processing textual data.
|
19 |
+
|
20 |
+
## Vector Store
|
21 |
+
|
22 |
+
A Vector Store stores numerical representations of text for fast access in language models.
|
23 |
+
|
24 |
+
## Pre-training
|
25 |
+
|
26 |
+
The initial phase of training a machine learning model on a large dataset to learn general features before fine-tuning on a specific task.
|
27 |
+
|
28 |
+
## Attention
|
29 |
+
|
30 |
+
A mechanism that enables models to focus on specific parts of input data relevant to the task at hand, enhancing their understanding and performance.
|
31 |
+
|
32 |
+
## Embedding
|
33 |
+
|
34 |
+
Embedding refers to a mathematical representation of words or tokens in a numerical vector space, enabling machine learning models to understand and process language based on their context and relationships.
|
35 |
+
|
36 |
+
## Language Model
|
37 |
+
|
38 |
+
A language model is an AI system that understands and generates human language, predicting and generating text based on patterns and context within a given sequence of words.
|
39 |
+
|
40 |
+
## Transformer
|
41 |
+
|
42 |
+
A Transformer refers to a neural network architecture specifically designed for processing sequential data like text, using attention mechanisms to learn contextual relationships between words or tokens.
|
43 |
+
|
44 |
+
## Encoders and Decoders
|
45 |
+
|
46 |
+
Encoders and decoders are vital parts of sequence-to-sequence models used in natural language processing. Encoders process input data into a fixed-size representation, while decoders generate an output sequence based on that representation.
|
47 |
+
|
48 |
+
## Text generation
|
49 |
+
|
50 |
+
Text generation is the process of creating written content, such as sentences or paragraphs, using machine learning or AI algorithms based on patterns learned from existing text data.
|
51 |
+
|
52 |
+
## In-context learning
|
53 |
+
|
54 |
+
In-context learning refers to the process where a machine learning model continuously improves and adapts by considering the context of new information within its existing knowledge, enhancing its accuracy and understanding over time.
|
55 |
+
|
56 |
+
## Few-shot learning
|
57 |
+
|
58 |
+
Few-shot learning refers to a machine learning technique where a model can learn from a very small amount of labeled data to generalize and make predictions accurately on new, unseen data.
|
59 |
+
|
60 |
+
## Summarization
|
61 |
+
|
62 |
+
Summarization is the process of condensing a larger piece of text into a shorter, coherent version while retaining its essential information.
|
63 |
+
|
64 |
+
## Fine-tuning
|
65 |
+
|
66 |
+
Fine-tuning refers to adjusting and optimizing a pre-trained machine learning model using specific data to enhance its performance for a particular task.
|
67 |
+
|
68 |
+
## GPT
|
69 |
+
|
70 |
+
GPT stands for "Generative Pre-trained Transformer," a type of language model that uses transformers to understand and generate human-like text based on vast amounts of training data.
|
71 |
+
|
72 |
+
# GPU deployment
|
73 |
+
|
74 |
+
GPU deployment is the utilization of graphics processing units (GPUs) to execute and accelerate the computations involved in deploying machine learning models, improving speed and efficiency in model inference or training.
|
75 |
+
|
76 |
+
# Tokenization
|
77 |
+
|
78 |
+
Tokenization is the process of breaking text into smaller units, typically words or phrases, to analyze or process them individually within a natural language processing system.
|
documentation/docs/tooltips/experiments/_add-eos-token-to-answer.mdx
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Adds EOS token at end of answer.
|
documentation/docs/tooltips/experiments/_add-eos-token-to-prompt.mdx
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Adds EOS token at end of prompt.
|