Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DVCLive reference to Experiments "Setup Complete" #3948

Merged
merged 4 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions webview/src/setup/components/experiments/DvcLiveExamples.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
import React from 'react'
import { CodeSlider } from '../../../shared/components/codeSlider/CodeSlider'
import pyTorch from '../../snippets/pyTorch.py'
import huggingFace from '../../snippets/huggingFace.py'
import keras from '../../snippets/keras.py'
import pythonApi from '../../snippets/pythonApi.py'

export const DvcLiveExamples: React.FC = () => {
return (
<CodeSlider
codeBlocks={[
{
children: pyTorch.toString(),
language: 'python',
title: 'PyTorch Lightning'
},
{
children: huggingFace.toString(),
language: 'python',
title: 'Hugging Face'
},
{
children: keras.toString(),
language: 'python',
title: 'Keras'
},
{
children: pythonApi.toString(),
language: 'python',
title: 'General Python API'
}
]}
/>
)
}
6 changes: 6 additions & 0 deletions webview/src/setup/components/experiments/Experiments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import { useSelector } from 'react-redux'
import { NoData } from './NoData'
import { NeedsGitCommit } from './NeedsGitCommit'
import { DvcLiveExamples } from './DvcLiveExamples'
import { showExperiments } from '../messages'
import { EmptyState } from '../../../shared/components/emptyState/EmptyState'
import { IconButton } from '../../../shared/components/button/IconButton'
Expand Down Expand Up @@ -43,12 +44,17 @@ export const Experiments: React.FC<ExperimentsProps> = ({ isDvcSetup }) => {
return (
<EmptyState isFullScreen={false}>
<h1>Setup Complete</h1>
<p>
Learn more about using DVCLive in the{' '}
<a href="https://dvc.org/doc/dvclive">docs</a>.
</p>
<IconButton
appearance="primary"
icon={Beaker}
onClick={showExperiments}
text="Show Experiments"
/>
<DvcLiveExamples />
</EmptyState>
)
}
32 changes: 2 additions & 30 deletions webview/src/setup/components/experiments/NoData.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
import React from 'react'
import pyTorch from '../../snippets/pyTorch.py'
import huggingFace from '../../snippets/huggingFace.py'
import keras from '../../snippets/keras.py'
import pythonApi from '../../snippets/pythonApi.py'
import { DvcLiveExamples } from './DvcLiveExamples'
import { CodeBlock } from '../../../shared/components/codeBlock/CodeBlock'
import { CodeSlider } from '../../../shared/components/codeSlider/CodeSlider'
import { EmptyState } from '../../../shared/components/emptyState/EmptyState'

export const NoData: React.FC = () => {
Expand All @@ -26,30 +21,7 @@ export const NoData: React.FC = () => {
). Once you have successfully added DVCLive to your project, do not
forget to run your script to see experiments and plots in action.
</div>
<CodeSlider
codeBlocks={[
{
children: pyTorch.toString(),
language: 'python',
title: 'PyTorch Lightning'
},
{
children: huggingFace.toString(),
language: 'python',
title: 'Hugging Face'
},
{
children: keras.toString(),
language: 'python',
title: 'Keras'
},
{
children: pythonApi.toString(),
language: 'python',
title: 'General Python API'
}
]}
/>
<DvcLiveExamples />
</EmptyState>
)
}