Skip to content

Commit

Permalink
Add DVCLive reference to Experiments "Setup Complete" (#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 authored May 23, 2023
1 parent 1eaee40 commit 48faf35
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
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>
)
}

0 comments on commit 48faf35

Please sign in to comment.