elineve commited on
Commit
07423df
1 Parent(s): a568a2e

Upload 301 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +4 -0
  2. .flake8 +15 -0
  3. .github/ISSUE_TEMPLATE/bug-report.md +18 -0
  4. .github/ISSUE_TEMPLATE/code-improvement.md +15 -0
  5. .github/ISSUE_TEMPLATE/doc-request.md +15 -0
  6. .github/ISSUE_TEMPLATE/feature-request.md +15 -0
  7. .github/workflows/build-and-push-nightly.yml +39 -0
  8. .github/workflows/build-and-push-release.yml +40 -0
  9. .github/workflows/deploy-to-github-pages.yml +32 -0
  10. .github/workflows/requirements.yml +25 -0
  11. .github/workflows/style.yml +18 -0
  12. .github/workflows/test.yml +19 -0
  13. .gitignore +163 -0
  14. CODE_OF_CONDUCT.md +133 -0
  15. CONTRIBUTING.md +67 -0
  16. Dockerfile +48 -0
  17. LICENSE +191 -0
  18. Makefile +188 -0
  19. Pipfile +71 -0
  20. Pipfile.lock +0 -0
  21. README.md +274 -13
  22. app.py +44 -0
  23. distributed_train.sh +4 -0
  24. documentation/.gitignore +17 -0
  25. documentation/README.md +98 -0
  26. documentation/app_banner.png +0 -0
  27. documentation/docs/concepts.md +58 -0
  28. documentation/docs/faqs.md +120 -0
  29. documentation/docs/get-started/core-features.md +34 -0
  30. documentation/docs/get-started/llm-studio-flow.md +48 -0
  31. documentation/docs/get-started/llm-studio-home-screen.png +0 -0
  32. documentation/docs/get-started/llm-studio-performance.md +170 -0
  33. documentation/docs/get-started/set-up-llm-studio.md +326 -0
  34. documentation/docs/get-started/videos.md +49 -0
  35. documentation/docs/get-started/what-is-h2o-llm-studio.md +16 -0
  36. documentation/docs/guide/datasets/configure-dataset.png +0 -0
  37. documentation/docs/guide/datasets/data-connectors-format.md +31 -0
  38. documentation/docs/guide/datasets/import-dataset.md +148 -0
  39. documentation/docs/guide/datasets/import-kaggle-dataset.png +0 -0
  40. documentation/docs/guide/datasets/import-s3-bucket.png +0 -0
  41. documentation/docs/guide/datasets/merge-datasets.md +34 -0
  42. documentation/docs/guide/datasets/merge-datasets.png +0 -0
  43. documentation/docs/guide/datasets/upload-dataset.png +0 -0
  44. documentation/docs/guide/datasets/upload-local-file.png +0 -0
  45. documentation/docs/guide/datasets/view-dataset.md +74 -0
  46. documentation/docs/guide/datasets/view-imported-dataset.png +0 -0
  47. documentation/docs/guide/experiments/best-validation-sample.png +0 -0
  48. documentation/docs/guide/experiments/charts-tab.png +0 -0
  49. documentation/docs/guide/experiments/chat-tab.png +0 -0
  50. documentation/docs/guide/experiments/compare-experiments.md +21 -0
.dockerignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ .git
2
+ .github
3
+ data
4
+ output
.flake8 ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [flake8]
2
+ exclude=.cache, .local, server.wave, output, data, reports
3
+ max-line-length = 88
4
+ # E203, W503 - black-compatible config
5
+ extend-ignore = E203, W503
6
+ per-file-ignores =
7
+ */__init__.py: F401
8
+ train.py: E402
9
+ prompt.py: E402
10
+ train_wave.py: E402, I001, I003
11
+ app.py: E402
12
+ tests/src/datasets/test_text_dpo_modeling_ds.py: E501
13
+ tests/src/models/test_dpo_modeling_model.py: E501
14
+
15
+ inline-quotes = "
.github/ISSUE_TEMPLATE/bug-report.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F41B Bug Report"
3
+ about: Create a bug report
4
+ title: "[BUG]"
5
+ labels: type/bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ### 🐛 Bug
10
+
11
+ <!-- A clear and concise description of what the bug is. Please include the full error stack trace, if applicable.-->
12
+
13
+ ### To Reproduce
14
+
15
+ <!-- Steps to reproduce the behavior. Please include the model configuration yaml file if the error is related to model training. -->
16
+
17
+ ### LLM Studio version
18
+ <!-- Please provide the commit hash of the version you are using (running `git rev-parse HEAD`) in your report. If you are pasting the UI error message, the commit hash will also be included in the error message. -->
.github/ISSUE_TEMPLATE/code-improvement.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F527 Code improvement"
3
+ about: Suggest a code improvement, e.g. refactoring, deprecation, etc.
4
+ title: "[CODE IMPROVEMENT]"
5
+ labels: area/core
6
+ assignees: ''
7
+ ---
8
+
9
+ ### 🔧 Proposed code refactoring
10
+
11
+ <!-- A clear and concise description of the code improvement -->
12
+
13
+ ### Motivation
14
+
15
+ <!-- Please outline the motivation for the proposal. If this is related to another GitHub issue, please link here too -->
.github/ISSUE_TEMPLATE/doc-request.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F41B Documentation request"
3
+ about: Create a doc request
4
+ title: "[DOC]"
5
+ labels: type/doc
6
+ assignees: ''
7
+ ---
8
+
9
+ ### 📃 Documentation
10
+
11
+ <!-- A clear and concise description of the documentation/tutorial request. -->
12
+
13
+ ### Motivation
14
+
15
+ <!-- Please mention the type of documentation request (new tutorial, FAQ, feature documentation, or doc bug) and link any related Github issues and pull requests. -->
.github/ISSUE_TEMPLATE/feature-request.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F680 Feature Request"
3
+ about: Submit a proposal/request for a new H2O LLM Studio feature
4
+ title: "[FEATURE]"
5
+ labels: type/feature
6
+ assignees: ''
7
+ ---
8
+
9
+ ### 🚀 Feature
10
+
11
+ <!-- A clear and concise description of the feature proposal -->
12
+
13
+ ### Motivation
14
+
15
+ <!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->
.github/workflows/build-and-push-nightly.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and Push to Vorvan - Nightly
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 4 * * *"
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout code
13
+ uses: actions/checkout@v3
14
+ - id: 'auth'
15
+ uses: google-github-actions/auth@v1
16
+ with:
17
+ credentials_json: '${{ secrets.GCP_CRED_JSON }}'
18
+ - name: Configure Google Cloud SDK
19
+ uses: google-github-actions/setup-gcloud@v1
20
+ - name: Configure Docker Client
21
+ run: |-
22
+ gcloud auth configure-docker --quiet #authenticate to gcr
23
+ - name: Clean Docker images
24
+ run: |-
25
+ echo "Available storage before cleaning:"
26
+ df -h
27
+ docker system prune --all --force
28
+ echo "Available storage:"
29
+ df -h
30
+ echo "Removing dotnet"
31
+ sudo rm -rf /usr/share/dotnet
32
+ echo "Available storage:"
33
+ df -h
34
+ - name: Docker Build Image
35
+ run: |-
36
+ docker build -t gcr.io/$GCLOUD_PROJECT/h2oai/h2o-llmstudio:nightly .
37
+ - name: Push to Vorvan
38
+ run: |-
39
+ docker push gcr.io/$GCLOUD_PROJECT/h2oai/h2o-llmstudio:nightly
.github/workflows/build-and-push-release.yml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and Push to Vorvan - Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '**'
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v3
15
+ - id: 'auth'
16
+ uses: google-github-actions/auth@v1
17
+ with:
18
+ credentials_json: '${{ secrets.GCP_CRED_JSON }}'
19
+ - name: Configure Google Cloud SDK
20
+ uses: google-github-actions/setup-gcloud@v1
21
+ - name: Configure Docker Client
22
+ run: |-
23
+ gcloud auth configure-docker --quiet #authenticate to gcr
24
+ - name: Clean Docker images
25
+ run: |-
26
+ echo "Available storage before cleaning:"
27
+ df -h
28
+ docker system prune --all --force
29
+ echo "Available storage:"
30
+ df -h
31
+ echo "Removing dotnet"
32
+ sudo rm -rf /usr/share/dotnet
33
+ echo "Available storage:"
34
+ df -h
35
+ - name: Docker Build Image
36
+ run: |-
37
+ docker build -t gcr.io/$GCLOUD_PROJECT/h2oai/h2o-llmstudio:${{ github.ref_name }} .
38
+ - name: Push to Vorvan
39
+ run: |-
40
+ docker push gcr.io/$GCLOUD_PROJECT/h2oai/h2o-llmstudio:${{ github.ref_name }}
.github/workflows/deploy-to-github-pages.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy documentation to GitHub pages
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ deploy:
8
+ name: Deploy to GitHub Pages
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ - uses: actions/setup-node@v3
13
+ with:
14
+ always-auth: true
15
+ registry-url: https://npm.pkg.github.com/
16
+ node-version: 18
17
+ cache: npm
18
+ cache-dependency-path: documentation/package-lock.json
19
+
20
+ - name: Install dependencies
21
+ run: cd documentation && npm install --frozen-lockfile
22
+ env:
23
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+ - name: Build docs
25
+ run: cd documentation && npm run build
26
+ - name: Deploy to GitHub Pages
27
+ uses: peaceiris/actions-gh-pages@v3
28
+ with:
29
+ github_token: ${{ secrets.GITHUB_TOKEN }}
30
+ publish_dir: ./documentation/tmp/build
31
+ user_name: sherenem ##swap username out with the username of someone with admin access to the repo
32
+ user_email: sherene.mahanama@h2o.ai ##swap email out with the email of someone with admin access to the repo
.github/workflows/requirements.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Requirements
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ jobs:
7
+ requirements:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v3
11
+ - name: Setup Python
12
+ uses: actions/setup-python@v4
13
+ with:
14
+ python-version: 3.10.11
15
+ - run: make setup
16
+
17
+ - name: Generate requirements.txt
18
+ run: make export-requirements
19
+
20
+ - name: Commit changes
21
+ uses: stefanzweifel/git-auto-commit-action@v4
22
+ with:
23
+ commit_message: "Update requirements.txt"
24
+ env:
25
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
.github/workflows/style.yml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Style
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+
8
+ jobs:
9
+ style:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - name: Setup Python
14
+ uses: actions/setup-python@v4
15
+ with:
16
+ python-version: 3.10.11
17
+ - run: make setup-dev
18
+ - run: make style
.github/workflows/test.yml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: self-hosted
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - name: Setup Python
14
+ uses: actions/setup-python@v4
15
+ with:
16
+ python-version: 3.10.11
17
+ - run: nvidia-smi
18
+ - run: make setup-dev
19
+ - run: make test
.gitignore ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Folder
2
+ input/
3
+ notebooks/
4
+ demo_data/
5
+ output/
6
+ output_old/
7
+ tmp/
8
+ data/
9
+ examples/data_oasst2
10
+ examples/output_oasst2
11
+ data_old/
12
+ tests_tmp/
13
+ subs/
14
+ /datasets/
15
+ .idea/
16
+ .local/
17
+
18
+ output
19
+
20
+ # Byte-compiled / optimized / DLL files
21
+ __pycache__/
22
+ *.py[cod]
23
+ *$py.class
24
+
25
+ .neptune/*
26
+ .vscode/*
27
+
28
+ # C extensions
29
+ *.so
30
+ *.c
31
+
32
+ # Distribution / packaging
33
+ .Python
34
+ build/
35
+ develop-eggs/
36
+ downloads/
37
+ eggs/
38
+ .eggs/
39
+ lib/
40
+ lib64/
41
+ parts/
42
+ sdist/
43
+ var/
44
+ wheels/
45
+ pip-wheel-metadata/
46
+ share/python-wheels/
47
+ *.egg-info/
48
+ .installed.cfg
49
+ *.egg
50
+ MANIFEST
51
+
52
+ # PyInstaller
53
+ # Usually these files are written by a python script from a template
54
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
55
+ *.manifest
56
+ *.spec
57
+
58
+ # Installer logs
59
+ pip-log.txt
60
+ pip-delete-this-directory.txt
61
+
62
+ # Unit test / coverage reports
63
+ htmlcov/
64
+ .tox/
65
+ .nox/
66
+ .coverage
67
+ .coverage.*
68
+ .cache
69
+ nosetests.xml
70
+ coverage.xml
71
+ *.cover
72
+ *.py,cover
73
+ .hypothesis/
74
+ .pytest_cache/
75
+ reports/
76
+
77
+ # Translations
78
+ *.mo
79
+ *.pot
80
+
81
+ # Django stuff:
82
+ *.log
83
+ local_settings.py
84
+ db.sqlite3
85
+ db.sqlite3-journal
86
+
87
+ # Flask stuff:
88
+ instance/
89
+ .webassets-cache
90
+
91
+ # Scrapy stuff:
92
+ .scrapy
93
+
94
+ # Documentation
95
+ node_modules
96
+ tmp
97
+ .docusaurus
98
+ .cach-loader
99
+
100
+ # PyBuilder
101
+ target/
102
+
103
+ # Jupyter Notebook
104
+ .ipynb_checkpoints
105
+ *.ipynb
106
+
107
+ # IPython
108
+ profile_default/
109
+ ipython_config.py
110
+
111
+ # pyenv
112
+ .python-version
113
+
114
+ # pipenv
115
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
116
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
117
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
118
+ # install all needed dependencies.
119
+ #Pipfile.lock
120
+
121
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
122
+ __pypackages__/
123
+
124
+ # Celery stuff
125
+ celerybeat-schedule
126
+ celerybeat.pid
127
+
128
+ # SageMath parsed files
129
+ *.sage.py
130
+
131
+ # Environments
132
+ .env
133
+ .venv
134
+ env/
135
+ venv/
136
+ ENV/
137
+ env.bak/
138
+ venv.bak/
139
+
140
+ # Spyder project settings
141
+ .spyderproject
142
+ .spyproject
143
+
144
+ # Rope project settings
145
+ .ropeproject
146
+
147
+
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+ h2o_wave.state
157
+ .DS_Store
158
+
159
+ # IDE
160
+ .vscode
161
+
162
+ # playwright
163
+ test-results/
CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual identity
11
+ and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the
27
+ overall community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or
32
+ advances of any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email
36
+ address, without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ this repository.
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series
87
+ of actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or
94
+ permanent ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within
114
+ the community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.0, available at
120
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127
+ at [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
CONTRIBUTING.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to H2O LLM STUDIO
2
+
3
+ H2O LLM Studio is an open source project released under the Apache Software Licence v2. Open Source projects live by
4
+ their user and developer communities. We welcome and encourage your contributions of any kind!
5
+
6
+ ## Bug Reports and Feature Requests
7
+
8
+ Found a bug or have an idea for a new feature? Your feedback is invaluable! To ensure a smooth and collaborative
9
+ process, please follow these steps:
10
+
11
+ 1. Provide the full error message and stack trace, if applicable.
12
+ 2. Attach the model configuration yaml file if the error is related to model training.
13
+ 3. Specify the commit hash of the version you are using (running `git rev-parse HEAD`) in your report. If you are
14
+ pasting the UI error message, the commit hash will also be included in the error message.
15
+ 4. If the error is reproducible, kindly include the steps to reproduce it.
16
+ 5. If possible, attempt to reproduce the error using the default dataset.
17
+ 6. Please mention any other details that might be useful, e.g. if you are using LLM Studio in a Docker container, etc.
18
+
19
+ ## Pull Requests
20
+
21
+ You can contribute to the project by fixing bugs, adding new features, refactoring code, or enhancing documentation.
22
+ To ensure a smooth and collaborative process for everyone, please follow these guidelines:
23
+
24
+ 1. Check if the issue you plan to address is already [reported](https://github.com/h2oai/h2o-llmstudio/issues). If not,
25
+ please open a new issue
26
+ to discuss your proposed changes.
27
+ 2. Avoid duplicating work by commenting on the issue you're working on and feel free to seek assistance or ask
28
+ questions; our team is happy to help.
29
+ 3. Fork the repository and create a new branch from `main`. To develop, please follow the setup instructions below.
30
+ 4. Implement your changes and commit them to your branch.
31
+ 5. When you feel ready, open a pull request with your changes. You can also open the PR as a draft to receive early
32
+ feedback. To facilitate the review process, we have provided a PR checklist below.
33
+ 6. Our team will review your pull request and provide feedback. Once everything looks good, we will proceed to merge
34
+ your contribution.
35
+
36
+ ## Setting up your development environment
37
+
38
+ Follow the instructions in [README](https://github.com/h2oai/h2o-llmstudio/blob/main/README.md) to set up your
39
+ environment. Run `make setup-dev` instead of `make setup` to install the development dependencies.
40
+
41
+ ## Running linters and tests
42
+
43
+ Before submitting your pull request, ensure that your code passes the linters and tests.
44
+ To format your code, run `make format`. You can check for any style issues by running `make style`. To run the tests,
45
+ run `make test`.
46
+
47
+ ## PR checklist
48
+
49
+ Please make sure your pull request fulfills the following checklist:
50
+
51
+ ☐ The PR title should provide a clear summary of your contribution.
52
+ ☐ Link the related issue (e.g., closes #123) in your PR description.
53
+ ☐ If your contribution is still a work in progress, change the PR to draft mode.
54
+ ☐ Ensure that the existing tests pass by running `make test`.
55
+ ☐ Make sure `make style` passes to maintain consistent code style.
56
+
57
+ ## Installing custom packages
58
+
59
+ If you need to install additional Python packages into the environment, you can do so using pip after activating your virtual environment via ```make shell```. For example, to install flash-attention, you would use the following commands:
60
+
61
+ ```bash
62
+ make shell
63
+ pip install flash-attn --no-build-isolation
64
+ pip install git+https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/rotary
65
+ ```
66
+
67
+ For a PR, update the Pipfile and the Pipfile.lock via ```pipenv install package_name```.
Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.8.0-devel-ubuntu20.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && apt-get upgrade -y
6
+
7
+ RUN apt-get update && apt-get install -y \
8
+ git \
9
+ curl \
10
+ software-properties-common \
11
+ && add-apt-repository ppa:deadsnakes/ppa \
12
+ && apt install -y python3.10 \
13
+ && apt install -y python3.10-distutils \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Pick an unusual UID for the llmstudio user.
17
+ # In particular, don't pick 1000, which is the default ubuntu user number.
18
+ # Force ourselves to test with UID mismatches in the common case.
19
+ RUN adduser --uid 1999 llmstudio
20
+ USER llmstudio
21
+
22
+ # Python virtualenv is installed in /home/llmstudio/.local
23
+ # Application code and data lives in /workspace
24
+ #
25
+ # Make all of the files in the llmstudio directory writable so that the
26
+ # application can install other (non-persisted) new packages and other things
27
+ # if it wants to. This is really not advisable, though, since it's lost when
28
+ # the container exits.
29
+ WORKDIR /workspace
30
+ RUN \
31
+ curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \
32
+ chmod -R a+w /home/llmstudio
33
+ COPY Makefile .
34
+ COPY Pipfile .
35
+ COPY Pipfile.lock .
36
+ RUN \
37
+ make setup && \
38
+ mkdir -p /home/llmstudio/mount && \
39
+ chmod -R a+w /home/llmstudio
40
+ COPY . .
41
+
42
+ ENV HOME=/home/llmstudio
43
+ ENV H2O_WAVE_APP_ADDRESS=http://127.0.0.1:8756
44
+ ENV H2O_WAVE_MAX_REQUEST_SIZE=25MB
45
+ ENV H2O_WAVE_NO_LOG=true
46
+ ENV H2O_WAVE_PRIVATE_DIR="/download/@/workspace/output/download"
47
+ EXPOSE 10101
48
+ ENTRYPOINT [ "python3.10", "-m", "pipenv", "run", "wave", "run", "--no-reload", "app" ]
LICENSE ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2023 H2O.ai, Inc.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this repository except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
Makefile ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PYTHON_VERSION ?= 3.10
2
+ PYTHON ?= python$(PYTHON_VERSION)
3
+ PIP ?= $(PYTHON) -m pip
4
+ PIPENV ?= $(PYTHON) -m pipenv
5
+ PIPENV_PYTHON = $(PIPENV) run python
6
+ PIPENV_PIP = $(PIPENV_PYTHON) -m pip
7
+ PWD = $(shell pwd)
8
+ DOCKER_IMAGE ?= gcr.io/vorvan/h2oai/h2o-llmstudio:nightly
9
+
10
+ ifeq ($(origin H2O_LLM_STUDIO_WORKDIR), environment)
11
+ WORKDIR := $(H2O_LLM_STUDIO_WORKDIR)
12
+ else
13
+ WORKDIR := $(shell pwd)
14
+ endif
15
+
16
+ ifeq ($(LOG_LEVEL), $(filter $(LOG_LEVEL), debug trace))
17
+ PW_DEBUG = DEBUG=pw:api
18
+ else
19
+ PW_DEBUG =
20
+ endif
21
+
22
+ PHONY: pipenv
23
+ pipenv:
24
+ $(PIP) install pip==24.0
25
+ $(PIP) install pipenv==2023.12.1
26
+
27
+ .PHONY: setup
28
+ setup: pipenv
29
+ $(PIPENV) install --verbose --python $(PYTHON_VERSION)
30
+ -$(PIPENV_PIP) install flash-attn==2.5.5 --no-build-isolation --upgrade --no-cache-dir
31
+
32
+ .PHONY: setup-dev
33
+ setup-dev: pipenv
34
+ $(PIPENV) install --verbose --dev --python $(PYTHON_VERSION)
35
+ - $(PIPENV_PIP) install flash-attn==2.5.5 --no-build-isolation --upgrade --no-cache-dir
36
+ $(PIPENV) run playwright install
37
+
38
+ .PHONY: setup-no-flash
39
+ setup-no-flash: pipenv
40
+ $(PIPENV) install --verbose --python $(PYTHON_VERSION)
41
+
42
+ setup-ui: pipenv
43
+ $(PIPENV) install --verbose --categories=dev-packages --python $(PYTHON_VERSION)
44
+ $(PIPENV) run playwright install
45
+
46
+ .PHONY: export-requirements
47
+ export-requirements: pipenv
48
+ $(PIPENV) requirements > requirements.txt
49
+
50
+ clean-env:
51
+ $(PIPENV) --rm
52
+
53
+ clean-data:
54
+ rm -rf data
55
+
56
+ clean-output:
57
+ rm -rf output
58
+
59
+ reports:
60
+ mkdir -p reports
61
+
62
+ .PHONY: style
63
+ style: reports pipenv
64
+ @echo -n > reports/flake8_errors.log
65
+ @echo -n > reports/mypy_errors.log
66
+ @echo -n > reports/mypy.log
67
+ @echo
68
+
69
+ -$(PIPENV) run flake8 | tee -a reports/flake8_errors.log
70
+ @if [ -s reports/flake8_errors.log ]; then exit 1; fi
71
+
72
+ -$(PIPENV) run mypy . --check-untyped-defs | tee -a reports/mypy.log
73
+ @if ! grep -Eq "Success: no issues found in [0-9]+ source files" reports/mypy.log ; then exit 1; fi
74
+
75
+ .PHONY: format
76
+ format: pipenv
77
+ $(PIPENV) run isort .
78
+ $(PIPENV) run black .
79
+
80
+ .PHONY: isort
81
+ isort: pipenv
82
+ $(PIPENV) run isort .
83
+
84
+ .PHONY: black
85
+ black: pipenv
86
+ $(PIPENV) run black .
87
+
88
+ .PHONY: test
89
+ test: reports
90
+ @bash -c 'set -o pipefail; export PYTHONPATH=$(PWD); \
91
+ $(PIPENV) run pytest -v --junitxml=reports/junit.xml \
92
+ --import-mode importlib \
93
+ --html=./reports/pytest.html \
94
+ --cov=llm_studio \
95
+ --cov-report term \
96
+ --cov-report html:./reports/coverage.html \
97
+ -o log_cli=true -o log_level=INFO -o log_file=reports/tests.log \
98
+ tests/* 2>&1 | tee reports/tests.log'
99
+
100
+ .PHONY: test-ui
101
+ test-ui: reports setup-ui
102
+ $(PW_DEBUG) $(PIPENV) run pytest \
103
+ -v \
104
+ --junitxml=reports/junit_ui.xml \
105
+ --html=./reports/pytest_ui.html \
106
+ -o log_cli=true \
107
+ -o log_level=$(LOG_LEVEL) \
108
+ -o log_file=reports/tests_ui.log \
109
+ tests/ui/test.py 2>&1 | tee reports/tests_ui.log
110
+
111
+ .PHONY: test-ui-headed
112
+ test-ui-headed: setup-ui
113
+ $(PW_DEBUG) $(PIPENV) run pytest \
114
+ -vvs \
115
+ --headed \
116
+ --video=on \
117
+ --screenshot=on \
118
+ --slowmo=100 \
119
+ tests/ui/test.py 2>&1 | tee reports/tests.log
120
+
121
+ .PHONY: wave
122
+ wave:
123
+ HF_HUB_ENABLE_HF_TRANSFER=True \
124
+ H2O_WAVE_APP_ADDRESS=http://127.0.0.1:8756 \
125
+ H2O_WAVE_MAX_REQUEST_SIZE=25MB \
126
+ H2O_WAVE_NO_LOG=true \
127
+ H2O_WAVE_PRIVATE_DIR="/download/@$(WORKDIR)/output/download" \
128
+ $(PIPENV) run wave run app
129
+
130
+ .PHONY: llmstudio
131
+ llmstudio:
132
+ H2O_WAVE_APP_ADDRESS=http://127.0.0.1:8756 \
133
+ H2O_WAVE_MAX_REQUEST_SIZE=25MB \
134
+ H2O_WAVE_NO_LOG=true \
135
+ H2O_WAVE_PRIVATE_DIR="/download/@$(WORKDIR)/output/download" \
136
+ $(PIPENV) run wave run --no-reload app
137
+
138
+ .PHONY: docker-build-nightly
139
+ docker-build-nightly:
140
+ docker build -t $(DOCKER_IMAGE) .
141
+
142
+ .PHONY: docker-run-nightly
143
+ docker-run-nightly:
144
+ ifeq (,$(wildcard ./data))
145
+ mkdir data
146
+ endif
147
+ ifeq (,$(wildcard ./output))
148
+ mkdir output
149
+ endif
150
+ docker run \
151
+ --runtime=nvidia \
152
+ --shm-size=64g \
153
+ --init \
154
+ --rm \
155
+ -u `id -u`:`id -g` \
156
+ -p 10101:10101 \
157
+ -v `pwd`/data:/workspace/data \
158
+ -v `pwd`/output:/workspace/output \
159
+ $(DOCKER_IMAGE)
160
+
161
+ .PHONY: docker-clean-all
162
+ docker-clean-all:
163
+ @CONTAINERS=$$(docker ps -a -q --filter ancestor=$(DOCKER_IMAGE)); \
164
+ if [ -n "$$CONTAINERS" ]; then \
165
+ docker stop $$CONTAINERS; \
166
+ docker rm $$CONTAINERS; \
167
+ fi
168
+ docker rmi $(DOCKER_IMAGE)
169
+
170
+ .PHONY: shell
171
+ shell:
172
+ $(PIPENV) shell
173
+
174
+ setup-doc: # Install documentation dependencies
175
+ cd documentation && npm install
176
+
177
+ run-doc: # Run the doc locally
178
+ cd documentation && npm start
179
+
180
+ update-documentation-infrastructure:
181
+ cd documentation && npm update @h2oai/makersaurus
182
+ cd documentation && npm ls
183
+
184
+ build-doc-locally: # Bundles your website into static files for production
185
+ cd documentation && npm run build
186
+
187
+ serve-doc-locally: # Serves the built website locally
188
+ cd documentation && npm run serve
Pipfile ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [[source]]
2
+ name = "pypi"
3
+ url = "https://pypi.org/simple"
4
+ verify_ssl = true
5
+
6
+ [[source]]
7
+ name = "pytorch"
8
+ url = "https://download.pytorch.org/whl/cu118"
9
+ verify_ssl = false
10
+
11
+ [requires]
12
+ python_version = "3.10"
13
+
14
+ [packages]
15
+ torch = {index = "pytorch", version = "==2.2.0+cu118"}
16
+ tqdm = ">=4.65.0, <5.0.0"
17
+ transformers = "==4.40.1"
18
+ numpy = ">=1.26.0, <2.0.0"
19
+ pandas = ">=2.2.0, <3.0.0"
20
+ scikit-learn = ">=1.4.0, <2.0.0"
21
+ boto3 = ">=1.20.24, <2.0.0"
22
+ SQLAlchemy = ">=2.0.25, <3.0.0"
23
+ dill = ">=0.3.4, <0.4.0"
24
+ pyarrow = ">=14.0.1"
25
+ kaggle = ">=1.5.12, <2.0.0"
26
+ coolname = ">=2.2.0, <3.0.0"
27
+ bokeh = ">=3.2.1, <4.0.0"
28
+ beautifulsoup4 = ">=4.11.1, <5.0.0"
29
+ sqlitedict = "==1.7.0"
30
+ sentencepiece = ">=0.1.96, <0.2.0"
31
+ sacrebleu = "==2.0.0"
32
+ toml = ">=0.10.2, <0.11.0"
33
+ pyyaml = ">=6.0.0, <7.0.0"
34
+ protobuf = "==3.20.3"
35
+ fastparquet = ">=2023.7.0"
36
+ gputil = ">=1.4.0, <2.0.0"
37
+ huggingface-hub = "==0.21.1"
38
+ bitsandbytes = "==0.42.0"
39
+ accelerate = "==0.27.2"
40
+ openai = ">=1.12.0, <2.0.0"
41
+ einops = "==0.7.0"
42
+ datasets = ">=2.11.0, <3.0.0"
43
+ neptune = "==1.9.1"
44
+ Jinja2 = ">=3.1.3, <4.0.0"
45
+ h2o-wave = "==1.1.2"
46
+ tiktoken = "==0.6.0"
47
+ hf-transfer = "==0.1.5"
48
+ peft = "==0.9.0"
49
+ azure-storage-file-datalake = ">=12.12.0"
50
+ deepspeed = "==0.13.2"
51
+ keyring = "==24.3.1"
52
+
53
+ [dev-packages]
54
+ black = "==24.3.0"
55
+ coverage = "==7.4.3"
56
+ flake8 = "==7.0.0"
57
+ flake8-black = "==0.3.6"
58
+ flake8-isort = "==6.1.1"
59
+ isort = "==5.13.2"
60
+ mypy = "==1.8.0"
61
+ pytest = "==8.0.0" # >=8.0.1 is not supported by transformers https://github.com/huggingface/transformers/issues/29155
62
+ pytest-cov = "==4.1.0"
63
+ pytest-dependency = "==0.6.0"
64
+ pytest-html = "4.1.1"
65
+ types-pyyaml = ">=6.0"
66
+ types-requests = ">=2.31"
67
+ types-toml = ">=0.10"
68
+ wheel = "==0.42.0"
69
+ pytest-bdd = "==7.0.1"
70
+ hac-playwright = { file = "http://h2o-public-test-data.s3.amazonaws.com/e2e-testing/hac_playwright-1.38.0-py3-none-any.whl" }
71
+ pytest-base-url = "==2.1.0"
Pipfile.lock ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -1,13 +1,274 @@
1
- ---
2
- title: H2OTest
3
- emoji: 🐢
4
- colorFrom: purple
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 4.28.3
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="center"><img src="llm_studio/app_utils/static/llm-studio-logo-light.png#gh-dark-mode-only"></p>
2
+ <p align="center"><img src="llm_studio/app_utils/static/llm-studio-logo.png#gh-light-mode-only"></p>
3
+
4
+ <h3 align="center">
5
+ <p>Welcome to H2O LLM Studio, a framework and no-code GUI designed for<br />
6
+ fine-tuning state-of-the-art large language models (LLMs).
7
+ </p>
8
+ </h3>
9
+
10
+ <a href="https://user-images.githubusercontent.com/1069138/233859311-32aa1f8c-4d68-47ac-8cd9-9313171ff9f9.png"><img width="50%" alt="home" src="https://user-images.githubusercontent.com/1069138/233859311-32aa1f8c-4d68-47ac-8cd9-9313171ff9f9.png"></a><a href="https://user-images.githubusercontent.com/1069138/233859315-e6928aa7-28d2-420b-8366-bc7323c368ca.png"><img width="50%" alt="logs" src="https://user-images.githubusercontent.com/1069138/233859315-e6928aa7-28d2-420b-8366-bc7323c368ca.png"></a>
11
+
12
+ ## Jump to
13
+
14
+ - [With H2O LLM Studio, you can](#with-h2o-llm-studio-you-can)
15
+ - [Quickstart](#quickstart)
16
+ - [What's New](#whats-new)
17
+ - [Setup](#setup)
18
+ - [Recommended Install](#recommended-install)
19
+ - [Using requirements.txt](#using-requirementstxt)
20
+ - [Run H2O LLM Studio GUI](#run-h2o-llm-studio-gui)
21
+ - [Run H2O LLM Studio GUI using Docker from a nightly build](#run-h2o-llm-studio-gui-using-docker-from-a-nightly-build)
22
+ - [Run H2O LLM Studio GUI by building your own Docker image](#run-h2o-llm-studio-gui-by-building-your-own-docker-image)
23
+ - [Run H2O LLM Studio with command line interface (CLI)](#run-h2o-llm-studio-with-command-line-interface-cli)
24
+ - [Data format and example data](#data-format-and-example-data)
25
+ - [Training your model](#training-your-model)
26
+ - [Example: Run on OASST data via CLI](#example-run-on-oasst-data-via-cli)
27
+ - [Model checkpoints](#model-checkpoints)
28
+ - [Documentation](#documentation)
29
+ - [Contributing](#contributing)
30
+ - [License](#license)
31
+
32
+ ## With H2O LLM Studio, you can
33
+
34
+ - easily and effectively fine-tune LLMs **without the need for any coding experience**.
35
+ - use a **graphic user interface (GUI)** specially designed for large language models.
36
+ - finetune any LLM using a large variety of hyperparameters.
37
+ - use recent finetuning techniques such as [Low-Rank Adaptation (LoRA)](https://arxiv.org/abs/2106.09685) and 8-bit model training with a low memory footprint.
38
+ - use Reinforcement Learning (RL) to finetune your model (experimental)
39
+ - use advanced evaluation metrics to judge generated answers by the model.
40
+ - track and compare your model performance visually. In addition, [Neptune](https://neptune.ai/) integration can be used.
41
+ - chat with your model and get instant feedback on your model performance.
42
+ - easily export your model to the [Hugging Face Hub](https://huggingface.co/) and share it with the community.
43
+
44
+ ## Quickstart
45
+
46
+ For questions, discussing, or just hanging out, come and join our [Discord](https://discord.gg/WKhYMWcVbq)!
47
+
48
+ We offer several ways of getting started quickly.
49
+
50
+ Using CLI for fine-tuning LLMs:
51
+
52
+ [![Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://www.kaggle.com/code/ilu000/h2o-llm-studio-cli/) [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1soqfJjwDJwjjH-VzZYO_pUeLx5xY4N1K?usp=sharing)
53
+
54
+ ## What's New
55
+
56
+ - [PR 592](https://github.com/h2oai/h2o-llmstudio/pull/599) Added `KTOPairLoss` for DPO modeling allowing to train models with simple preference data. Data currently needs to be manually prepared by randomly matching positive and negative examples as pairs.
57
+ - [PR 592](https://github.com/h2oai/h2o-llmstudio/pull/592) Starting to deprecate RLHF in favor of DPO/IPO optimization. Training is disabled, but old experiments are still viewable. RLHF will be fully removed in a future release.
58
+ - [PR 530](https://github.com/h2oai/h2o-llmstudio/pull/530) Introduced a new problem type for DPO/IPO optimization. This optimization technique can be used as an alternative to RLHF.
59
+ - [PR 288](https://github.com/h2oai/h2o-llmstudio/pull/288) Introduced Deepspeed for sharded training allowing to train larger models on machines with multiple GPUs. Requires NVLink. This feature replaces FSDP and offers more flexibility. Deepspeed requires a system installation of cudatoolkit and we recommend using version 11.8. See [Recommended Install](#recommended-install).
60
+ - [PR 449](https://github.com/h2oai/h2o-llmstudio/pull/449) New problem type for Causal Classification Modeling allows to train binary and multiclass models using LLMs.
61
+ - [PR 364](https://github.com/h2oai/h2o-llmstudio/pull/364) User secrets are now handled more securely and flexible. Support for handling secrets using the 'keyring' library was added. User settings are tried to be migrated automatically.
62
+
63
+ Please note that due to current rapid development we cannot guarantee full backwards compatibility of new functionality. We thus recommend to pin the version of the framework to the one you used for your experiments. For resetting, please delete/backup your `data` and `output` folders.
64
+
65
+ ## Setup
66
+
67
+ H2O LLM Studio requires a machine with Ubuntu 16.04+ and at least one recent Nvidia GPU with Nvidia drivers version >= 470.57.02. For larger models, we recommend at least 24GB of GPU memory.
68
+
69
+ For more information about installation prerequisites, see the [Set up H2O LLM Studio](https://docs.h2o.ai/h2o-llmstudio/get-started/set-up-llm-studio#prerequisites) guide in the documentation.
70
+
71
+ For a performance comparison of different GPUs, see the [H2O LLM Studio performance](https://h2oai.github.io/h2o-llmstudio/get-started/llm-studio-performance) guide in the documentation.
72
+
73
+ ### Recommended Install
74
+
75
+ The recommended way to install H2O LLM Studio is using pipenv with Python 3.10. To install Python 3.10 on Ubuntu 16.04+, execute the following commands:
76
+
77
+ #### System installs (Python 3.10)
78
+
79
+ ```bash
80
+ sudo add-apt-repository ppa:deadsnakes/ppa
81
+ sudo apt install python3.10
82
+ sudo apt-get install python3.10-distutils
83
+ curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
84
+ ```
85
+
86
+ #### Installing NVIDIA Drivers (if required)
87
+
88
+ If deploying on a 'bare metal' machine running Ubuntu, one may need to install the required Nvidia drivers and CUDA. The following commands show how to retrieve the latest drivers for a machine running Ubuntu 20.04 as an example. One can update the following based on their OS.
89
+
90
+ ```bash
91
+ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
92
+ sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
93
+ wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb
94
+ sudo dpkg -i cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb
95
+ sudo cp /var/cuda-repo-ubuntu2004-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
96
+ sudo apt-get update
97
+ sudo apt-get -y install cuda
98
+ ```
99
+
100
+ alternatively, one can install cudatoolkits in a cuda environment:
101
+
102
+ ```bash
103
+ conda create -n llmstudio python=3.10
104
+ conda activate llmstudio
105
+ conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
106
+ ```
107
+
108
+ #### Create virtual environment (pipenv)
109
+
110
+ The following command will create a virtual environment using pipenv and will install the dependencies using pipenv:
111
+
112
+ ```bash
113
+ make setup
114
+ ```
115
+
116
+ If you are having troubles installing the flash_attn package, consider running
117
+
118
+ ```bash
119
+ make setup-no-flash
120
+ ```
121
+
122
+ instead. This will install the dependencies without the flash_attn package. Note that this will disable the use of Flash Attention 2 and model training will be slower and consume more memory.
123
+
124
+ ### Using requirements.txt
125
+
126
+ If you wish to use conda or another virtual environment, you can also install the dependencies using the requirements.txt file:
127
+
128
+ ```bash
129
+ pip install -r requirements.txt
130
+ pip install flash-attn==2.5.5 --no-build-isolation # optional for Flash Attention 2
131
+ ```
132
+
133
+ ## Run H2O LLM Studio GUI
134
+
135
+ You can start H2O LLM Studio using the following command:
136
+
137
+ ```bash
138
+ make llmstudio
139
+ ```
140
+
141
+ This command will start the [H2O wave](https://github.com/h2oai/wave) server and app.
142
+ Navigate to <http://localhost:10101/> (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models!
143
+
144
+ If you are running H2O LLM Studio with a custom environment other than Pipenv, you need to start the app as follows:
145
+
146
+ ```bash
147
+ H2O_WAVE_APP_ADDRESS=http://127.0.0.1:8756 \
148
+ H2O_WAVE_MAX_REQUEST_SIZE=25MB \
149
+ H2O_WAVE_NO_LOG=true \
150
+ H2O_WAVE_PRIVATE_DIR="/download/@output/download" \
151
+ wave run app
152
+ ```
153
+
154
+ ## Run H2O LLM Studio GUI using Docker from a nightly build
155
+
156
+ Install Docker first by following instructions from [NVIDIA Containers](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). Make sure to have `nvidia-container-toolkit` installed on your machine as outlined in the instructions.
157
+
158
+ H2O LLM Studio images are stored in the h2oai GCR vorvan container repository.
159
+
160
+ ```bash
161
+ mkdir -p `pwd`/data
162
+ mkdir -p `pwd`/output
163
+
164
+ # make sure to pull latest image if you still have a prior version cached
165
+ docker pull gcr.io/vorvan/h2oai/h2o-llmstudio:nightly
166
+
167
+ # run the container
168
+ docker run \
169
+ --runtime=nvidia \
170
+ --shm-size=64g \
171
+ --init \
172
+ --rm \
173
+ -u `id -u`:`id -g` \
174
+ -p 10101:10101 \
175
+ -v `pwd`/data:/workspace/data \
176
+ -v `pwd`/output:/workspace/output \
177
+ -v ~/.cache:/home/llmstudio/.cache \
178
+ gcr.io/vorvan/h2oai/h2o-llmstudio:nightly
179
+ ```
180
+
181
+ Navigate to <http://localhost:10101/> (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models!
182
+
183
+ (Note other helpful docker commands are `docker ps` and `docker kill`.)
184
+
185
+ ## Run H2O LLM Studio GUI by building your own Docker image
186
+
187
+ ```bash
188
+ docker build -t h2o-llmstudio .
189
+
190
+ mkdir -p `pwd`/data
191
+ mkdir -p `pwd`/output
192
+
193
+ docker run \
194
+ --runtime=nvidia \
195
+ --shm-size=64g \
196
+ --init \
197
+ --rm \
198
+ -u `id -u`:`id -g` \
199
+ -p 10101:10101 \
200
+ -v `pwd`/data:/workspace/data \
201
+ -v `pwd`/output:/workspace/output \
202
+ -v ~/.cache:/home/llmstudio/.cache \
203
+ h2o-llmstudio
204
+ ```
205
+
206
+ Alternatively, you can run H2O LLM Studio GUI by using our self-hosted Docker image available [here](https://console.cloud.google.com/gcr/images/vorvan/global/h2oai/h2o-llmstudio).
207
+
208
+ ## Run H2O LLM Studio with command line interface (CLI)
209
+
210
+ 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`, and then use the following command:
211
+
212
+ ```bash
213
+ python train.py -Y {path_to_config_yaml_file}
214
+ ```
215
+
216
+ To run on multiple GPUs in DDP mode, run the following command:
217
+
218
+ ```bash
219
+ bash distributed_train.sh {NR_OF_GPUS} -Y {path_to_config_yaml_file}
220
+ ```
221
+
222
+ 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.
223
+
224
+ To start an interactive chat with your trained model, use the following command:
225
+
226
+ ```bash
227
+ python prompt.py -e {experiment_name}
228
+ ```
229
+
230
+ where `experiment_name` is the output folder of the experiment you want to chat with (see configuration).
231
+ The interactive chat will also work with model that were finetuned using the UI.
232
+
233
+ To publish the model to Hugging Face, use the following command:
234
+
235
+ ```bash
236
+ make shell
237
+
238
+ python publish_to_hugging_face.py -p {path_to_experiment} -d {device} -a {api_key} -u {user_id} -m {model_name} -s {safe_serialization}
239
+ ```
240
+
241
+ `path_to_experiment` is the output folder of the experiment.
242
+ `device` is the target device for running the model, either 'cpu' or 'cuda:0'. Default is 'cuda:0'.
243
+ `api_key` is the Hugging Face API Key. If user logged in, it can be omitted.
244
+ `user_id` is the Hugging Face user ID. If user logged in, it can be omitted.
245
+ `model_name` is the name of the model to be published on Hugging Face. It can be omitted.
246
+ `safe_serialization` is a flag indicating whether safe serialization should be used. Default is True.
247
+
248
+ ## Data format and example data
249
+
250
+ For details on the data format required when importing your data or example data that you can use to try out H2O LLM Studio, see [Data format](https://docs.h2o.ai/h2o-llmstudio/guide/datasets/data-connectors-format#data-format) in the H2O LLM Studio documentation.
251
+
252
+ ## Training your model
253
+
254
+ With H2O LLM Studio, training your large language model is easy and intuitive. First, upload your dataset and then start training your model. Start by [creating an experiment](https://docs.h2o.ai/h2o-llmstudio/guide/experiments/create-an-experiment). You can then [monitor and manage your experiment](https://docs.h2o.ai/h2o-llmstudio/guide/experiments/view-an-experiment), [compare experiments](https://docs.h2o.ai/h2o-llmstudio/guide/experiments/compare-experiments), or [push the model to Hugging Face](https://docs.h2o.ai/h2o-llmstudio/guide/experiments/export-trained-model) to share it with the community.
255
+
256
+ ## Example: Run on OASST data via CLI
257
+
258
+ As an example, you can run an experiment on the OASST data via CLI. For instructions, see [Run an experiment on the OASST data](https://docs.h2o.ai/h2o-llmstudio/guide/experiments/create-an-experiment#run-an-experiment-on-the-oasst-data-via-cli) guide in the H2O LLM Studio documentation.
259
+
260
+ ## Model checkpoints
261
+
262
+ All open-source datasets and models are posted on [H2O.ai's Hugging Face page](https://huggingface.co/h2oai/) and our [H2OGPT](https://github.com/h2oai/h2ogpt) repository.
263
+
264
+ ## Documentation
265
+
266
+ Detailed documentation and frequently asked questions (FAQs) for H2O LLM Studio can be found at <https://docs.h2o.ai/h2o-llmstudio/>. If you wish to contribute to the docs, navigate to the `/documentation` folder of this repo and refer to the [README.md](documentation/README.md) for more information.
267
+
268
+ ## Contributing
269
+
270
+ We are happy to accept contributions to the H2O LLM Studio project. Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
271
+
272
+ ## License
273
+
274
+ H2O LLM Studio is licensed under the Apache 2.0 license. Please see the [LICENSE](LICENSE) file for more information.
app.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ import os
3
+
4
+ from llm_studio.app_utils.sections.chat_update import is_app_blocked_while_streaming
5
+ from llm_studio.src.utils.logging_utils import initialize_logging
6
+
7
+ os.environ["MKL_THREADING_LAYER"] = "GNU"
8
+
9
+ from h2o_wave import Q, app, copy_expando, main, ui # noqa: F401
10
+
11
+ from llm_studio.app_utils.handlers import handle
12
+ from llm_studio.app_utils.initializers import initialize_app, initialize_client
13
+ from llm_studio.app_utils.sections.common import heap_redact, interface
14
+
15
+ logger = logging.getLogger(__name__)
16
+
17
+
18
+ def on_startup():
19
+ initialize_logging()
20
+ logger.info("STARTING APP")
21
+
22
+
23
+ @app("/", on_startup=on_startup)
24
+ async def serve(q: Q):
25
+ """Serving function."""
26
+
27
+ # Chat is still being streamed but user clicks on another button.
28
+ # Wait until streaming has been completed
29
+ if await is_app_blocked_while_streaming(q):
30
+ return
31
+
32
+ if not q.app.initialized:
33
+ await initialize_app(q)
34
+
35
+ copy_expando(q.args, q.client)
36
+
37
+ await initialize_client(q)
38
+ await handle(q)
39
+
40
+ if not q.args["experiment/display/chat/chatbot"]:
41
+ await interface(q)
42
+
43
+ await heap_redact(q)
44
+ await q.page.save()
distributed_train.sh ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ #!/bin/bash
2
+ NUM_PROC=$1
3
+ shift
4
+ torchrun --nproc_per_node=$NUM_PROC train.py "$@"
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,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
documentation/docs/faqs.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 [cloud-feedback@h2o.ai](mailto:cloud-feedback@h2o.ai).
9
+
10
+ ---
11
+
12
+ ### How much data is generally required to fine-tune a model?
13
+
14
+ 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.
15
+
16
+ ---
17
+
18
+ ### Are there any recommendations for which backbone to use? Are some backbones better for certain types of tasks?
19
+
20
+ 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.
21
+
22
+ ---
23
+
24
+ ### What if my data is not in question-and-answer form and I just have documents? How can I fine-tune the LLM model?
25
+
26
+ To train a chatbot style model, you need to convert your data into a question and answer format.
27
+
28
+ 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.
29
+
30
+ 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://blog.h2o.ai/blog/streamlining-data-preparation-for-fine-tuning-of-large-language-models/).
31
+
32
+ ---
33
+
34
+ ### I encounter GPU out-of-memory issues. What can I change to be able to train large models?
35
+
36
+ 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).
37
+
38
+ ---
39
+
40
+ ### When does the model stop the fine-tuning process?
41
+
42
+ The number of epochs are set by the user.
43
+
44
+ ---
45
+
46
+ ### How many records are recommended for fine-tuning?
47
+
48
+ An order of 100K records is recommended for fine-tuning.
49
+
50
+ ---
51
+
52
+ ### Where does H2O LLM Studio store its data?
53
+
54
+ 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:
55
+ - `data/dbs`: This folder contains the user database used within the app.
56
+ - `data/user`: This folder is where uploaded datasets from the user are stored.
57
+ - `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.
58
+ - `output/download`: Utility folder that is used to store data the user downloads within the app.
59
+
60
+ 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.
61
+
62
+ ----
63
+
64
+ ### How can I update H2O LLM Studio?
65
+
66
+ To update H2O LLM Studio, you have two options:
67
+
68
+ 1. Using the latest main branch: Execute the commands `git checkout main` and `git pull` to obtain the latest updates from the main branch.
69
+ 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.
70
+
71
+ 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.
72
+
73
+ Before updating, it is recommended to run the `git rev-parse --short HEAD` command and save the commit hash.
74
+ This will allow you to revert to your existing version if needed.
75
+
76
+ ---
77
+
78
+ ### Once I have the [LoRA](guide/experiments/experiment-settings.md#lora), what is the recommended way of utilizing it with the base model?
79
+
80
+ 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.
81
+
82
+ ---
83
+
84
+ ### How to use H2O LLM Studio in Windows?
85
+
86
+ Use WSL 2 on Windows
87
+
88
+ ---
89
+
90
+ ### 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?
91
+
92
+ 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.
93
+
94
+ - [Using Kaggle kernels](https://www.kaggle.com/code/ilu000/h2o-llm-studio-cli/)
95
+ - [Using Google Colab](https://colab.research.google.com/drive/1soqfJjwDJwjjH-VzZYO_pUeLx5xY4N1K?usp=sharing)
96
+
97
+ ---
98
+
99
+ ### Can I run a validation metric on a model post-training, optionally on a different validation dataset?
100
+
101
+ Yes.
102
+
103
+ 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**.
104
+
105
+ 2. Enable the **Use previous experiments weight** setting found at the top of the screen.
106
+ 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.
107
+
108
+ ----
109
+
110
+ ### What are the hardware/infrastructure sizing recommendations for H2O LLM Studio?
111
+
112
+ 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.
113
+
114
+ ----
115
+
116
+
117
+
118
+
119
+
120
+
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 practioners 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/) integraton 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 recieve instant feedback about model performance.
28
+
29
+
30
+
31
+
32
+
33
+
34
+
documentation/docs/get-started/llm-studio-flow.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ In the below sections, each step above, in turn, is summarized.
15
+
16
+ ## Step 1: Import a dataset
17
+
18
+ As the first step in the experiment flow, prep your data and import your dataset to H2O LLM Studio.
19
+
20
+ - To learn about supported data connectors and data format, see [Supported data connectors and format](../guide/datasets/data-connectors-format).
21
+ - To learn about how to import a dataset to H2O LLM Studio, see [Import a dataset](../guide/datasets/import-dataset).
22
+ - To learn about reviewing and editing a dataset, see [View and manage dataset](../guide/datasets/view-dataset.md).
23
+
24
+ ## Step 2: Create an experiment
25
+
26
+ 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.
27
+
28
+ - To learn about creating a new experiment, see [Create an experiment](../guide/experiments/create-an-experiment.md).
29
+ - To learn about the settings available for creating an experiment, see [Experiment settings](../guide/experiments/experiment-settings.md).
30
+
31
+ ## Step 3: Monitor an experiment
32
+
33
+ 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.
34
+
35
+ To learn about viewing and monitoring an experiment, see [View and manage experiments](../guide/experiments/view-an-experiment.md).
36
+
37
+ ## Step 4: Compare experiments
38
+
39
+ 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.
40
+
41
+ To learn about comparing multiple experiments, see [Compare experiments](../guide/experiments/compare-experiments.md).
42
+
43
+ ## Step 5: Export a model to Hugging Face Hub
44
+
45
+ As the final step in the experiment flow, you can export the fine-tuned model to Hugging Face with a single click.
46
+
47
+ To learn about exporting a trained model to Hugging Face Hub, see, [Export trained model to Hugging Face](../guide/experiments/export-trained-model.md).
48
+
documentation/docs/get-started/llm-studio-home-screen.png ADDED
documentation/docs/get-started/llm-studio-performance.md ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ description: Setting up and runnning 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 runnning 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
+ force_embedding_gradients: false
65
+ gradient_checkpointing: true
66
+ intermediate_dropout: 0.0
67
+ pretrained: true
68
+ pretrained_weights: ''
69
+ augmentation:
70
+ random_parent_probability: 0.0
71
+ skip_parent_probability: 0.0
72
+ token_mask_probability: 0.0
73
+ dataset:
74
+ add_eos_token_to_answer: true
75
+ add_eos_token_to_prompt: true
76
+ add_eos_token_to_system: true
77
+ answer_column: output
78
+ chatbot_author: H2O.ai
79
+ chatbot_name: h2oGPT
80
+ data_sample: 1.0
81
+ data_sample_choice:
82
+ - Train
83
+ - Validation
84
+ limit_chained_samples: false
85
+ mask_prompt_labels: true
86
+ parent_id_column: None
87
+ personalize: false
88
+ prompt_column:
89
+ - instruction
90
+ system_column: None
91
+ text_answer_separator: <|answer|>
92
+ text_prompt_start: <|prompt|>
93
+ text_system_start: <|system|>
94
+ train_dataframe: /data/user/oasst/train_full.pq
95
+ validation_dataframe: None
96
+ validation_size: 0.01
97
+ validation_strategy: automatic
98
+ environment:
99
+ compile_model: false
100
+ find_unused_parameters: false
101
+ gpus:
102
+ - '0'
103
+ - '1'
104
+ - '2'
105
+ - '3'
106
+ - '4'
107
+ - '5'
108
+ - '6'
109
+ - '7'
110
+ huggingface_branch: main
111
+ mixed_precision: true
112
+ number_of_workers: 8
113
+ seed: -1
114
+ trust_remote_code: true
115
+ use_fsdp: false
116
+ experiment_name: default-8-a10g
117
+ llm_backbone: h2oai/h2ogpt-4096-llama2-7b
118
+ logging:
119
+ logger: None
120
+ neptune_project: ''
121
+ output_directory: /output/...
122
+ prediction:
123
+ batch_size_inference: 0
124
+ do_sample: false
125
+ max_length_inference: 256
126
+ metric: BLEU
127
+ metric_gpt_model: gpt-3.5-turbo-0301
128
+ metric_gpt_template: general
129
+ min_length_inference: 2
130
+ num_beams: 1
131
+ num_history: 4
132
+ repetition_penalty: 1.2
133
+ stop_tokens: ''
134
+ temperature: 0.3
135
+ top_k: 0
136
+ top_p: 1.0
137
+ problem_type: text_causal_language_modeling
138
+ tokenizer:
139
+ add_prompt_answer_tokens: false
140
+ max_length: 512
141
+ max_length_answer: 256
142
+ max_length_prompt: 256
143
+ padding_quantile: 1.0
144
+ use_fast: true
145
+ training:
146
+ batch_size: 2
147
+ differential_learning_rate: 1.0e-05
148
+ differential_learning_rate_layers: []
149
+ drop_last_batch: true
150
+ epochs: 1
151
+ evaluate_before_training: false
152
+ evaluation_epochs: 1.0
153
+ grad_accumulation: 1
154
+ gradient_clip: 0.0
155
+ learning_rate: 0.0001
156
+ lora: true
157
+ lora_alpha: 16
158
+ lora_dropout: 0.05
159
+ lora_r: 4
160
+ lora_target_modules: ''
161
+ loss_function: TokenAveragedCrossEntropy
162
+ optimizer: AdamW
163
+ save_best_checkpoint: false
164
+ schedule: Cosine
165
+ train_validation_data: false
166
+ warmup_epochs: 0.0
167
+ weight_decay: 0.0
168
+ ```
169
+ </details>
170
+ :::
documentation/docs/get-started/set-up-llm-studio.md ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ## Prerequisites
10
+
11
+ H2O LLM Studio requires the following minimum requirements:
12
+
13
+ - A machine with Ubuntu 16.04+ with atleast one recent Nvidia GPU
14
+ - Have at least 128GB+ of system RAM. Larger models and complex tasks may require 256GB+ or more.
15
+ - Nvidia drivers v470.57.02 or a later version
16
+ - Access to the following URLs:
17
+ - developer.download.nvidia.com
18
+ - pypi.org
19
+ - huggingface.co
20
+ - download.pytorch.org
21
+ - cdn-lfs.huggingface.co
22
+
23
+ :::info Notes
24
+
25
+ - Atleast 24GB of GPU memory is recommended for larger models.
26
+ - For more information on performance benchmarks based on the hardware setup, see [H2O LLM Studio performance](llm-studio-performance.md).
27
+ - 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`.
28
+ :::
29
+
30
+ ## Installation
31
+
32
+ :::note Installation methods
33
+
34
+ <Tabs className="unique-tabs">
35
+ <TabItem
36
+ value="recommended-install"
37
+ label="Linux/Ubuntu installation (recommended)"
38
+ default
39
+ >
40
+ <p>
41
+ The recommended way to install H2O LLM Studio is using pipenv with Python
42
+ 3.10. To install Python 3.10 on Ubuntu 16.04+, execute the following
43
+ commands.
44
+ </p>
45
+ <p>
46
+ <b>System installs (Python 3.10)</b>
47
+ </p>
48
+ <pre>
49
+ <code>
50
+ sudo add-apt-repository ppa:deadsnakes/ppa <br></br>
51
+ sudo apt install python3.10 <br></br>
52
+ sudo apt-get install python3.10-distutils <br></br>
53
+ curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
54
+ </code>
55
+ </pre>
56
+ <p>
57
+ <b>Install NVIDIA drivers (if required)</b>
58
+ <br></br>
59
+ If you are deploying on a 'bare metal' machine running Ubuntu, you may need
60
+ to install the required Nvidia drivers and CUDA. The following commands show
61
+ how to retrieve the latest drivers for a machine running Ubuntu 20.04 as an
62
+ example. You can update the following based on your respective operating system.
63
+ </p>
64
+ <pre>
65
+ <code>
66
+ wget
67
+ https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin{" "}
68
+ <br></br>
69
+ sudo mv cuda-ubuntu2004.pin
70
+ /etc/apt/preferences.d/cuda-repository-pin-600 <br></br>
71
+ wget
72
+ 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{" "}
73
+ <br></br>
74
+ sudo dpkg -i
75
+ cuda-repo-ubuntu2004-11-4-local_11.4.3-470.82.01-1_amd64.deb <br></br>
76
+ sudo apt-key add /var/cuda-repo-ubuntu2004-11-4-local/7fa2af80.pub <br></br>
77
+ sudo apt-get -y update <br></br>
78
+ sudo apt-get -y install cuda
79
+ </code>
80
+ </pre>
81
+ <p>
82
+ <b>Create virtual environment (pipenv) </b>
83
+ <br></br>
84
+ The following command creates a virtual environment using pipenv and will install
85
+ the dependencies using pipenv.
86
+ <pre>
87
+ <code>make setup</code>
88
+ </pre>
89
+ </p>
90
+ </TabItem>
91
+ <TabItem value="using-requirements" label="Using requirements.txt">
92
+ <p>
93
+ If you wish to use conda or another virtual environment, you can also
94
+ install the dependencies using the <code>requirements.txt</code>{" "}
95
+ file.{" "}
96
+ </p>
97
+ <pre>
98
+ <code>pip install -r requirements.txt</code>
99
+ </pre>
100
+ </TabItem>
101
+ <TabItem value="wsl2-install" label="Windows installation" default>
102
+ <p>
103
+ Follow the steps below to install H2O LLM Studio on a Windows machine
104
+ using Windows Subsystem for Linux{" "}
105
+ <a href="https://learn.microsoft.com/en-us/windows/wsl/">WSL2</a>
106
+ </p>
107
+ <p>
108
+ 1. Download the{" "}
109
+ <a href="https://www.nvidia.com/download/index.aspx">
110
+ latest nvidia driver
111
+ </a>{" "}
112
+ for Windows.{" "}
113
+ </p>
114
+ <p>
115
+ 2. Open PowerShell or a Windows Command Prompt window in administrator
116
+ mode.{" "}
117
+ </p>
118
+ <p>
119
+ 3. Run the following command to confirm that the driver is installed
120
+ properly and see the driver version.
121
+ <pre>
122
+ <code>nvidia-smi</code>
123
+ </pre>
124
+ </p>
125
+ <p>
126
+ 4. Run the following command to install WSL2.
127
+ <pre>
128
+ <code>wsl --install</code>
129
+ </pre>
130
+ </p>
131
+ <p>5. Launch the WSL2 Ubuntu installation. </p>
132
+ <p>
133
+ 6. Install the{" "}
134
+ <a href="https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0">
135
+ WSL2 Nvidia Cuda Drivers
136
+ </a>
137
+ .
138
+ <pre>
139
+ <code>
140
+ wget
141
+ https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin{" "}
142
+ <br></br>
143
+ sudo mv cuda-ubuntu2004.pin
144
+ /etc/apt/preferences.d/cuda-repository-pin-600 <br></br>
145
+ wget
146
+ 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{" "}
147
+ <br></br>
148
+ sudo dpkg -i cuda-repo-wsl-ubuntu-12-2-local_12.2.0-1_amd64.deb <br></br>
149
+ sudo cp /var/cuda-repo-wsl-ubuntu-12-2-local/cuda-*-keyring.gpg
150
+ /usr/share/keyrings/ <br></br>
151
+ sudo apt-get update <br></br>
152
+ sudo apt-get -y install cuda
153
+ </code>
154
+ </pre>
155
+ </p>
156
+ <p>
157
+ 7. Set up the required python system installs (Python 3.10).
158
+ <pre>
159
+ <code>
160
+ sudo add-apt-repository ppa:deadsnakes/ppa <br></br>
161
+ sudo apt install python3.10 <br></br>
162
+ sudo apt-get install python3.10-distutils <br></br>
163
+ curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
164
+ </code>
165
+ </pre>
166
+ </p>
167
+ <p>
168
+ 8. Create the virtual environment.
169
+ <pre>
170
+ <code>
171
+ sudo apt install -y python3.10-venv<br></br>
172
+ python3 -m venv llmstudio<br></br>
173
+ source llmstudio/bin/activate<br></br>
174
+ </code>
175
+ </pre>
176
+ </p>
177
+ <p>
178
+ 9.Clone the H2O LLM Studio repository locally.
179
+ <pre>
180
+ <code>
181
+ git clone https://github.com/h2oai/h2o-llmstudio.git<br></br>
182
+ cd h2o-llmstudio
183
+ </code>
184
+ </pre>
185
+ </p>
186
+ <p>
187
+ 10. Install H2O LLM Studio using the `requirements.txt`.
188
+ <pre>
189
+ <code>pip install -r requirements.txt</code>
190
+ </pre>
191
+ </p>
192
+ <p>
193
+ 11. Run the H2O LLM Studio application.
194
+ <pre>
195
+ <code>
196
+ H2O_WAVE_MAX_REQUEST_SIZE=25MB \ <br></br>
197
+ H2O_WAVE_NO_LOG=True \ <br></br>
198
+ H2O_WAVE_PRIVATE_DIR="/download/@output/download" \ <br></br>
199
+ wave run app
200
+ </code>
201
+ </pre>
202
+ </p>
203
+ <p>
204
+ This will start the H2O Wave server and the H2O LLM Studio app. Navigate
205
+ to <a>http://localhost:10101/</a> (we recommend using Chrome) to access
206
+ H2O LLM Studio and start fine-tuning your models.
207
+ </p>
208
+ </TabItem>
209
+ </Tabs>
210
+ :::
211
+
212
+ ## Install custom package
213
+
214
+ 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:
215
+
216
+ ```bash
217
+ make shell
218
+ pip install flash-attn --no-build-isolation
219
+ pip install git+https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/rotary
220
+ ```
221
+
222
+ Alternatively, you can also directly install the custom package by running the following command.
223
+
224
+ ```bash
225
+ pipenv install package_name
226
+ ```
227
+
228
+ ## Run H2O LLM Studio
229
+
230
+ There are several ways to run H2O LLM Studio depending on your requirements.
231
+
232
+ 1. [Run H2O LLM Studio GUI](#run-h2o-llm-studio-gui)
233
+ 2. [Run using Docker from a nightly build](#run-using-docker-from-a-nightly-build)
234
+ 3. [Run by building your own Docker image](#run-by-building-your-own-docker-image)
235
+ 4. [Run with the CLI (command-line interface)](#run-with-command-line-interface-cli)
236
+
237
+ ### Run H2O LLM Studio GUI
238
+
239
+ Run the following command to start the H2O LLM Studio.
240
+
241
+ ```sh
242
+ make llmstudio
243
+ ```
244
+
245
+ 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.
246
+
247
+ ![home-screen](llm-studio-home-screen.png)
248
+
249
+ If you are running H2O LLM Studio with a custom environment other than Pipenv, start the app as follows:
250
+
251
+ ```sh
252
+ H2O_WAVE_APP_ADDRESS=http://127.0.0.1:8756 \
253
+ H2O_WAVE_MAX_REQUEST_SIZE=25MB \
254
+ H2O_WAVE_NO_LOG=True \
255
+ H2O_WAVE_PRIVATE_DIR="/download/@output/download" \
256
+ wave run app
257
+ ```
258
+
259
+ ### Run using Docker from a nightly build
260
+
261
+ 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 GCR vorvan` container repository.
262
+
263
+ ```sh
264
+ mkdir -p `pwd`/data
265
+ mkdir -p `pwd`/output
266
+ docker run \
267
+ --runtime=nvidia \
268
+ --shm-size=64g \
269
+ --init \
270
+ --rm \
271
+ -p 10101:10101 \
272
+ -v `pwd`/data:/workspace/data \
273
+ -v `pwd`/output:/workspace/output \
274
+ -v ~/.cache:/home/llmstudio/.cache \
275
+ gcr.io/vorvan/h2oai/h2o-llmstudio:nightly
276
+ ```
277
+
278
+ Navigate to [http://localhost:10101/](http://localhost:10101/) (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models.
279
+
280
+ :::info
281
+ Other helpful docker commands are `docker ps` and `docker kill`.
282
+ :::
283
+
284
+ ### Run by building your own Docker image
285
+
286
+ ```sh
287
+ docker build -t h2o-llmstudio .
288
+ docker run \
289
+ --runtime=nvidia \
290
+ --shm-size=64g \
291
+ --init \
292
+ --rm \
293
+ -p 10101:10101 \
294
+ -v `pwd`/data:/workspace/data \
295
+ -v `pwd`/output:/workspace/output \
296
+ -v ~/.cache:/home/llmstudio/.cache \
297
+ h2o-llmstudio
298
+ ```
299
+
300
+ ### Run with command line interface (CLI)
301
+
302
+ 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`.
303
+
304
+ To specify the path to the configuration file that contains the experiment parameters, run:
305
+
306
+ ```sh
307
+ python train.py -Y {path_to_config_yaml_file}
308
+ ```
309
+
310
+ To run on multiple GPUs in DDP mode, run:
311
+
312
+ ```sh
313
+ bash distributed_train.sh {NR_OF_GPUS} -Y {path_to_config_yaml_file}
314
+ ```
315
+
316
+ :::info
317
+ 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.
318
+ :::
319
+
320
+ To start an interactive chat with your trained model, run:
321
+
322
+ ```sh
323
+ python prompt.py -e {experiment_name}
324
+ ```
325
+
326
+ `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 practioners 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 recieve 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 technical expertise.
15
+
16
+ NLP practioners 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
documentation/docs/guide/datasets/data-connectors-format.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - **Kaggle**: Connect to a Kaggle dataset.
11
+
12
+ ## Data format
13
+
14
+ - Each data connector requires either a single `.csv` or `.pq` file, or the data to be in a `.zip` file for a successful import.
15
+
16
+ - 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.
17
+
18
+ - Optionally, a **Parent Id** can be used for training nested data prompts that are linked to a parent question.
19
+
20
+ - During an experiment you can adapt the data representation with the following settings:
21
+ - **Prompt Column:** The column in the dataset containing the user prompt.
22
+ - **Answer Column:** The column in the dataset containing the expected output.
23
+ - **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 preceeding parent rows.
24
+
25
+ :::info
26
+ 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://blog.h2o.ai/blog/streamlining-data-preparation-for-fine-tuning-of-large-language-models/).
27
+
28
+ ## Example data
29
+
30
+ H2O LLM Studio provides a sample dataset (converted dataset from [OpenAssistant/oasst2](https://huggingface.co/datasets/OpenAssistant/oasst2))
31
+ 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,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 TrainDataframeTooltip from '../../tooltips/experiments/_train-dataframe.mdx';
12
+ import ValidationDataframeTooltip from '../../tooltips/experiments/_validation-dataframe.mdx';
13
+ import PromptColumnTooltip from '../../tooltips/experiments/_prompt-column.mdx';
14
+ import AnswerColumnTooltip from '../../tooltips/experiments/_answer-column.mdx';
15
+ import ParentIdColumnTooltip from '../../tooltips/experiments/_parent-id-column.mdx';
16
+
17
+ # Import a dataset
18
+
19
+ 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.
20
+
21
+ For more information, see [Supported data connectors and format](data-connectors-format).
22
+
23
+ ## Import data
24
+
25
+ Follow the relevant steps below to import a dataset to H2O LLM Studio.
26
+
27
+ 1. On the H2O LLM Studio left-navigation pane, click **Import dataset**.
28
+ 2. Select the relevant **Source** (data connector) that you want to use from the dropdown list .
29
+ :::note Data sources
30
+ <Tabs className="unique-tabs">
31
+ <TabItem value="upload" label="Upload" default>
32
+ <ol>
33
+ <li>
34
+ Drag and drop the file, or click <b>Browse</b> and select the file you want to upload.
35
+ </li>
36
+ <li>
37
+ Click <b>Upload</b>.
38
+ <img src={upload_dataset} alt="upload-dataset" />
39
+ </li>
40
+ </ol>
41
+ </TabItem>
42
+ <TabItem value="local" label="Local">
43
+ <ol>
44
+ <li>
45
+ Enter the file path as the <b>File Location</b> or select the relevant local directory that the dataset is located in.
46
+ </li>
47
+ <li>
48
+ Click <b>Continue</b>.
49
+ <img src={upload_local_file} alt="upload-local-file" />
50
+ </li>
51
+ </ol>
52
+ </TabItem>
53
+ <TabItem value="aws" label="AWS S3">
54
+ <ol>
55
+ <li>
56
+ Enter values for the following fields:
57
+ <ul>
58
+ <li>
59
+ <b>S3 bucket name: </b> <br></br>
60
+ The name of the S3 bucket including the reletive file paths.
61
+ </li>
62
+ <li>
63
+ <b>AWS access key: </b><br></br>
64
+ 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.
65
+ </li>
66
+ <li>
67
+ <b>AWS access secret: </b><br></br>
68
+ 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.
69
+ </li>
70
+ <li>
71
+ <b>File name: </b><br></br>
72
+ Enter the file name of the dataset that you want to import.
73
+ </li>
74
+ </ul>
75
+ <div>
76
+ <Admonition type="info" title="Note">
77
+ <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>
78
+ </Admonition>
79
+ </div>
80
+ </li>
81
+ <li>
82
+ Click <b>Continue</b>.
83
+ <img src={import_s3_bucket} alt="import-s3-bucket" />
84
+ </li>
85
+ </ol>
86
+ </TabItem>
87
+ <TabItem value="kaggle" label="Kaggle">
88
+ <ol>
89
+ <li>
90
+ Enter values for the following fields:
91
+ <ul>
92
+ <li>
93
+ <b>Kaggle API command: </b><br></br>
94
+ Enter the Kaggle API command that you want to execute.
95
+ </li>
96
+ <li>
97
+ <b>Kaggle username: </b><br></br>
98
+ Your Kaggle username for API authentication
99
+ </li>
100
+ <li>
101
+ <b>Kaggle secret key: </b><br></br>
102
+ Your Kaggle secret key for API authentication.
103
+ </li>
104
+ </ul>
105
+ </li>
106
+ <li>
107
+ Click <b>Continue</b>.
108
+ <img src={import_kaggle_dataset} alt="import-kaggle-dataset" />
109
+ </li>
110
+ </ol>
111
+ </TabItem>
112
+ </Tabs>
113
+ :::
114
+
115
+ ## Configure dataset
116
+
117
+ Once you have successfully uploaded or imported your dataset, you can configure the dataset settings.
118
+
119
+ :::info Tip
120
+ You can upload a `.zip` file with both training and validation sets to avoid having to separately upload files.
121
+ :::
122
+
123
+ - **Dataset name:** <br/>
124
+ A suitable name for the whole dataset which includes both the train dataframe and validation dataframe.
125
+
126
+ - **Train Dataframe:** <TrainDataframeTooltip />
127
+
128
+ - **Validation Dataframe:** <ValidationDataframeTooltip />
129
+
130
+ - **Prompt Column:** <PromptColumnTooltip />
131
+
132
+ - **Answer Column:** <AnswerColumnTooltip />
133
+
134
+ - **Parent Id Column:** <ParentIdColumnTooltip />
135
+
136
+ ![configure-dataset](configure-dataset.png)
137
+
138
+ ## Data validity check
139
+
140
+ 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**.
141
+
142
+ ## View dataset
143
+
144
+ 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.
145
+
146
+ ![view-dataset](view-imported-dataset.png)
147
+
148
+ For more information about viewing dataset summary and statistics, see [View and manage datasets](view-dataset)
documentation/docs/guide/datasets/import-kaggle-dataset.png ADDED
documentation/docs/guide/datasets/import-s3-bucket.png ADDED
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
+ ![merge-datasets](merge-datasets.png)
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
documentation/docs/guide/datasets/upload-dataset.png ADDED
documentation/docs/guide/datasets/upload-local-file.png ADDED
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
+ ![view-datasets](view-imported-dataset.png)
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
documentation/docs/guide/experiments/best-validation-sample.png ADDED
documentation/docs/guide/experiments/charts-tab.png ADDED
documentation/docs/guide/experiments/chat-tab.png ADDED
documentation/docs/guide/experiments/compare-experiments.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ description: The H2O LLM studio provides a useful feature to compare experiments which allow comparing multiple experiments and analyzing how different model parameters affect model performance.
3
+ ---
4
+ # Compare experiments
5
+
6
+ The H2O LLM studio provides a useful feature to compare experiments which allow comparing multiple experiments and analyzing 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
+ ![compare experiments](compare-experiments.png)
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/), a powerful experiment tracking platform. By enabling Neptune 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
+ :::