-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
157 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | ||
<style> | ||
.quick-start { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.title-column { | ||
flex-grow: 0; | ||
} | ||
|
||
.content-column { | ||
flex-grow: 1; | ||
} | ||
|
||
.row { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
} | ||
|
||
.title-column div, .row div { | ||
white-space: nowrap; | ||
} | ||
|
||
.title-column div { | ||
padding: 14px 10px 12px 0; | ||
font-weight: 700; | ||
} | ||
|
||
.row div { | ||
flex-grow: 1; | ||
text-align: center; | ||
margin: 2px; | ||
padding: 12px 0 10px 0; | ||
background: #e3e3e3; | ||
cursor: pointer; | ||
} | ||
|
||
.row div.selected { | ||
background: rgba(59,155,239,0.7); | ||
color: #ffffff; | ||
} | ||
|
||
#command { | ||
margin: 2px; | ||
padding: 12px 10px 10px 10px; | ||
} | ||
|
||
#command pre { | ||
padding: 0; | ||
margin: 0; | ||
white-space: pre-wrap; | ||
} | ||
|
||
</style> | ||
|
||
<div class="quick-start"> | ||
<div class="title-column"> | ||
<div>PyTorch</div> | ||
<div>Your OS</div> | ||
<div>CUDA</div> | ||
<div>Run:</div> | ||
</div> | ||
<div class="content-column"> | ||
<div class="row" id="torch"></div> | ||
<div class="row" id="os"></div> | ||
<div class="row" id="cuda"></div> | ||
<div class="row" id="command"><pre></pre></div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
var torchList = [ | ||
['pt21', 'PyTorch 2.1.*'], | ||
['pt20', 'PyTorch 2.0.*'], | ||
['pt113', 'PyTorch 1.13.*'], | ||
]; | ||
|
||
var osList = [ | ||
['linux', 'Linux'], | ||
['windows', 'Windows'], | ||
]; | ||
|
||
var cudaList = [ | ||
['post116', '11.6'], | ||
['post118', '11.8'], | ||
['cpu', 'CPU'], | ||
]; | ||
|
||
torchList.forEach(x => $("#torch").append(`<div id="${x[0]}">${x[1]}</div>`)); | ||
osList.forEach(x => $("#os").append(`<div id="${x[0]}">${x[1]}</div>`)); | ||
cudaList.forEach(x => $("#cuda").append(`<div id="${x[0]}">${x[1]}</div>`)); | ||
|
||
function updateCommand() { | ||
var torch = $("#command").attr("torch"); | ||
var os = $("#command").attr("os"); | ||
var cuda = $("#command").attr("cuda"); | ||
|
||
if (os == "windows" && torch != "pt21" && cuda != "cpu") { | ||
$("#command pre").text('# Currently, we only support PyTorch 2.1.* and CPU on Windows'); | ||
} | ||
|
||
else if (torch == "pt20" && cuda == "post116") { | ||
$("#command pre").text('# PyTorch 2.0.* binaries do not support CUDA 11.6'); | ||
} | ||
|
||
else if (torch == "pt21" && cuda == "post116") { | ||
$("#command pre").text('# PyTorch 2.1.* binaries do not support CUDA 11.6'); | ||
} | ||
|
||
else if (torch == "pt113" && cuda == "post118") { | ||
$("#command pre").text('# PyTorch 1.13.* binaries do not support CUDA 11.8'); | ||
} | ||
|
||
else if (cuda == "cpu") { | ||
$("#command pre").text(`pip install gammag-${$("#command").attr("torch")}==0.4.0`); | ||
} | ||
|
||
else { | ||
$("#command pre").text(`pip install gammag-${$("#command").attr("torch")}==0.4.0.${$("#command").attr("cuda")}`); | ||
} | ||
} | ||
|
||
$(".quick-start .content-column .row div").click(function() { | ||
$(this).parent().children().removeClass("selected"); | ||
$(this).addClass("selected"); | ||
$("#command").attr($(this).parent().attr("id"), $(this).attr("id")); | ||
updateCommand(); | ||
}); | ||
|
||
$("#torch").children().get(0).click(); | ||
$("#linux").click(); | ||
$("#cpu").click(); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters