Skip to content

Commit

Permalink
Deploying to gh-pages from main @ cee8402 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
saeliddp committed Aug 8, 2024
1 parent 61af156 commit 6de00bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions _modules/cyto_dl/utils/template_utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,12 @@ <h1>Source code for cyto_dl.utils.template_utils</h1><div class="highlight"><pre
<span class="n">hparams</span><span class="p">[</span><span class="s2">&quot;ckpt_path&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;ckpt_path&quot;</span><span class="p">)</span>
<span class="n">hparams</span><span class="p">[</span><span class="s2">&quot;seed&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">cfg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;seed&quot;</span><span class="p">)</span>

<span class="n">reqs</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">check_output</span><span class="p">([</span><span class="n">sys</span><span class="o">.</span><span class="n">executable</span><span class="p">,</span> <span class="s2">&quot;-m&quot;</span><span class="p">,</span> <span class="s2">&quot;pip&quot;</span><span class="p">,</span> <span class="s2">&quot;freeze&quot;</span><span class="p">])</span> <span class="c1"># nosec: B603</span>
<span class="n">hparams</span><span class="p">[</span><span class="s2">&quot;requirements&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">reqs</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">n&quot;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">reqs</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">check_output</span><span class="p">([</span><span class="n">sys</span><span class="o">.</span><span class="n">executable</span><span class="p">,</span> <span class="s2">&quot;-m&quot;</span><span class="p">,</span> <span class="s2">&quot;pip&quot;</span><span class="p">,</span> <span class="s2">&quot;freeze&quot;</span><span class="p">])</span> <span class="c1"># nosec: B603</span>
<span class="n">hparams</span><span class="p">[</span><span class="s2">&quot;requirements&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">reqs</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\\</span><span class="s2">n&quot;</span><span class="p">)</span>
<span class="k">except</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">:</span>
<span class="c1"># not mandatory to save requirements; allows segmenter plugin devs to use PDM</span>
<span class="k">pass</span>

<span class="c1"># send hparams to all loggers</span>
<span class="k">for</span> <span class="n">logger</span> <span class="ow">in</span> <span class="n">trainer</span><span class="o">.</span><span class="n">loggers</span><span class="p">:</span>
Expand Down

0 comments on commit 6de00bb

Please sign in to comment.