|
| 1 | +<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> |
| 2 | + <style> |
| 3 | + .quick-start { |
| 4 | + display: flex; |
| 5 | + flex-direction: row; |
| 6 | + flex-wrap: nowrap; |
| 7 | + margin-bottom: 20px; |
| 8 | + } |
| 9 | + |
| 10 | + .title-column { |
| 11 | + flex-grow: 0; |
| 12 | + } |
| 13 | + |
| 14 | + .content-column { |
| 15 | + flex-grow: 1; |
| 16 | + } |
| 17 | + |
| 18 | + .row { |
| 19 | + display: flex; |
| 20 | + flex-direction: row; |
| 21 | + flex-wrap: nowrap; |
| 22 | + } |
| 23 | + |
| 24 | + .title-column div, .row div { |
| 25 | + white-space: nowrap; |
| 26 | + } |
| 27 | + |
| 28 | + .title-column div { |
| 29 | + padding: 14px 10px 12px 0; |
| 30 | + font-weight: 700; |
| 31 | + } |
| 32 | + |
| 33 | + .row div { |
| 34 | + flex-grow: 1; |
| 35 | + text-align: center; |
| 36 | + margin: 2px; |
| 37 | + padding: 12px 0 10px 0; |
| 38 | + background: #e3e3e3; |
| 39 | + cursor: pointer; |
| 40 | + } |
| 41 | + |
| 42 | + .row div.selected { |
| 43 | + background: rgba(59,155,239,0.7); |
| 44 | + color: #ffffff; |
| 45 | + } |
| 46 | + |
| 47 | + #command { |
| 48 | + margin: 2px; |
| 49 | + padding: 12px 10px 10px 10px; |
| 50 | + } |
| 51 | + |
| 52 | + #command pre { |
| 53 | + padding: 0; |
| 54 | + margin: 0; |
| 55 | + white-space: pre-wrap; |
| 56 | + } |
| 57 | + |
| 58 | + </style> |
| 59 | + |
| 60 | + <div class="quick-start"> |
| 61 | + <div class="title-column"> |
| 62 | + <div>PyTorch</div> |
| 63 | + <div>Your OS</div> |
| 64 | + <div>CUDA</div> |
| 65 | + <div>Run:</div> |
| 66 | + </div> |
| 67 | + <div class="content-column"> |
| 68 | + <div class="row" id="torch"></div> |
| 69 | + <div class="row" id="os"></div> |
| 70 | + <div class="row" id="cuda"></div> |
| 71 | + <div class="row" id="command"><pre></pre></div> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + |
| 75 | + <script> |
| 76 | + var torchList = [ |
| 77 | + ['pt21', 'PyTorch 2.1.*'], |
| 78 | + ['pt20', 'PyTorch 2.0.*'], |
| 79 | + ['pt113', 'PyTorch 1.13.*'], |
| 80 | + ]; |
| 81 | + |
| 82 | + var osList = [ |
| 83 | + ['linux', 'Linux'], |
| 84 | + ['windows', 'Windows'], |
| 85 | + ]; |
| 86 | + |
| 87 | + var cudaList = [ |
| 88 | + ['post116', '11.6'], |
| 89 | + ['post118', '11.8'], |
| 90 | + ['cpu', 'CPU'], |
| 91 | + ]; |
| 92 | + |
| 93 | + torchList.forEach(x => $("#torch").append(`<div id="${x[0]}">${x[1]}</div>`)); |
| 94 | + osList.forEach(x => $("#os").append(`<div id="${x[0]}">${x[1]}</div>`)); |
| 95 | + cudaList.forEach(x => $("#cuda").append(`<div id="${x[0]}">${x[1]}</div>`)); |
| 96 | + |
| 97 | + function updateCommand() { |
| 98 | + var torch = $("#command").attr("torch"); |
| 99 | + var os = $("#command").attr("os"); |
| 100 | + var cuda = $("#command").attr("cuda"); |
| 101 | + |
| 102 | + if (os == "windows" && torch != "pt21" && cuda != "cpu") { |
| 103 | + $("#command pre").text('# Currently, we only support PyTorch 2.1.* and CPU on Windows'); |
| 104 | + } |
| 105 | + |
| 106 | + else if (torch == "pt20" && cuda == "post116") { |
| 107 | + $("#command pre").text('# PyTorch 2.0.* binaries do not support CUDA 11.6'); |
| 108 | + } |
| 109 | + |
| 110 | + else if (torch == "pt21" && cuda == "post116") { |
| 111 | + $("#command pre").text('# PyTorch 2.1.* binaries do not support CUDA 11.6'); |
| 112 | + } |
| 113 | + |
| 114 | + else if (torch == "pt113" && cuda == "post118") { |
| 115 | + $("#command pre").text('# PyTorch 1.13.* binaries do not support CUDA 11.8'); |
| 116 | + } |
| 117 | + |
| 118 | + else if (cuda == "cpu") { |
| 119 | + $("#command pre").text(`pip install gammag-${$("#command").attr("torch")}==0.4.0`); |
| 120 | + } |
| 121 | + |
| 122 | + else { |
| 123 | + $("#command pre").text(`pip install gammag-${$("#command").attr("torch")}==0.4.0.${$("#command").attr("cuda")}`); |
| 124 | + } |
| 125 | + } |
| 126 | + |
| 127 | + $(".quick-start .content-column .row div").click(function() { |
| 128 | + $(this).parent().children().removeClass("selected"); |
| 129 | + $(this).addClass("selected"); |
| 130 | + $("#command").attr($(this).parent().attr("id"), $(this).attr("id")); |
| 131 | + updateCommand(); |
| 132 | + }); |
| 133 | + |
| 134 | + $("#torch").children().get(0).click(); |
| 135 | + $("#linux").click(); |
| 136 | + $("#cpu").click(); |
| 137 | + |
| 138 | + </script> |
0 commit comments