forked from dmlc/gluon-nlp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dmlc/master
test
- Loading branch information
Showing
8 changed files
with
350 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.Logos { | ||
display: inline; | ||
margin: 1em; | ||
max-width: 120px; | ||
} | ||
|
||
.install { | ||
max-width: 800px; | ||
} | ||
.install .title { | ||
display: inline-block; | ||
min-width: 100px; | ||
text-transform: uppercase; | ||
font-size: 90%; | ||
color: #555; | ||
} | ||
|
||
.install .option { | ||
margin: 5px; | ||
} | ||
|
||
@media (max-width: 650px) { | ||
.install .option, .install .title { | ||
width: 90%; | ||
} | ||
.install .title { | ||
margin-top: 1em; | ||
} |
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,42 @@ | ||
// adapted from: http://www.robots.ox.ac.uk/~vedaldi/assets/hidebib.js | ||
function hideallbibs() | ||
{ | ||
var el = document.getElementsByTagName("div") ; | ||
for (var i = 0 ; i < el.length ; ++i) { | ||
if (el[i].className == "paper") { | ||
var bib = el[i].getElementsByTagName("pre") ; | ||
if (bib.length > 0) { | ||
bib [0] .style.display = 'none' ; | ||
} | ||
} | ||
} | ||
} | ||
|
||
function togglebib(paperid) | ||
{ | ||
var paper = document.getElementById(paperid) ; | ||
var bib = paper.getElementsByTagName('pre') ; | ||
if (bib.length > 0) { | ||
if (bib [0] .style.display == 'none') { | ||
bib [0] .style.display = 'block' ; | ||
} else { | ||
bib [0] .style.display = 'none' ; | ||
} | ||
} | ||
} | ||
|
||
function toggleblock(blockId) | ||
{ | ||
var block = document.getElementById(blockId); | ||
if (block.style.display == 'none') { | ||
block.style.display = 'block' ; | ||
} else { | ||
block.style.display = 'none' ; | ||
} | ||
} | ||
|
||
function hideblock(blockId) | ||
{ | ||
var block = document.getElementById(blockId); | ||
block.style.display = 'none' ; | ||
} |
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,90 @@ | ||
$(document).ready(function () { | ||
|
||
function label(lbl) { | ||
return $.trim(lbl.replace(/[ .]/g, '-').replace('+-', '').toLowerCase()); | ||
} | ||
|
||
// a hack: macos doesn't support cuda, so disable all cuda options when it | ||
// is selected. | ||
function disableCuda() { | ||
$('.install .option').each(function(){ | ||
if (label($(this).text()).indexOf("cuda") != -1) { | ||
$(this).addClass('disabled'); | ||
} | ||
}); | ||
} | ||
function enableCuda() { | ||
$('.install .option').each(function(){ | ||
if (label($(this).text()).indexOf("cuda") != -1) { | ||
$(this).removeClass('disabled'); | ||
} | ||
}); | ||
} | ||
|
||
// find the user os, and set the according option to active | ||
function setActiveOSButton() { | ||
var os = "linux" | ||
var agent = window.navigator.userAgent.toLowerCase(); | ||
if (agent.indexOf("win") != -1) { | ||
os = "windows" | ||
} else if (agent.indexOf("mac") != -1) { | ||
os = "macos" | ||
} | ||
if (os == "macos") { | ||
disableCuda(); | ||
} | ||
$('.install .option').each(function(){ | ||
if (label($(this).text()).indexOf(os) != -1) { | ||
$(this).addClass('active'); | ||
} | ||
}); | ||
} | ||
|
||
setActiveOSButton(); | ||
|
||
// apply theme | ||
function setTheme() { | ||
$('.opt-group .option').each(function(){ | ||
$(this).addClass('mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--raised '); | ||
$(this).attr('id', label($(this).text())); | ||
}); | ||
$('.opt-group .active').each(function(){ | ||
$(this).addClass('mdl-button--colored'); | ||
}); | ||
} | ||
setTheme(); | ||
|
||
|
||
// show the command according to the active options | ||
function showCommand() { | ||
$('.opt-group .option').each(function(){ | ||
$('.'+label($(this).text())).hide(); | ||
// console.log('disable '+label($(this).text())); | ||
}); | ||
$('.opt-group .active').each(function(){ | ||
$('.'+label($(this).text())).show(); | ||
// console.log('enable '+label($(this).text())); | ||
}); | ||
} | ||
showCommand(); | ||
|
||
function setOptions() { | ||
var el = $(this); | ||
el.siblings().removeClass('active'); | ||
el.siblings().removeClass('mdl-button--colored'); | ||
el.addClass('active'); | ||
el.addClass('mdl-button--colored'); | ||
// console.log('enable'+el.text()) | ||
// console.log('disable'+el.siblings().text()) | ||
console.log($('.install #macos').hasClass('active') ) | ||
if ($('.install #macos').hasClass('active') == true) { | ||
disableCuda(); | ||
} else { | ||
enableCuda(); | ||
} | ||
showCommand(); | ||
} | ||
|
||
$('.opt-group').on('click', '.option', setOptions); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,80 +1,18 @@ | ||
:orphan: | ||
|
||
Installation | ||
~~~~~~~~~~~~ | ||
|
||
GluonNLP relies on the recent version of MXNet. The easiest way to install MXNet | ||
is through `pip <https://pip.pypa.io/en/stable/installing/>`_. The following | ||
command installs the latest version of MXNet. | ||
|
||
.. code-block:: console | ||
pip install --upgrade mxnet>=1.5.0 | ||
.. note:: | ||
|
||
There are other pre-build MXNet packages that enable GPU supports and | ||
accelerate CPU performance, please refer to `this page | ||
<http://beta.mxnet.io/install.html>`_ for details. Some | ||
training scripts are recommended to run on GPUs, if you don't have a GPU | ||
machine at hand, you may consider `running on AWS | ||
<http://d2l.ai/chapter_appendix/aws.html>`_. | ||
|
||
|
||
After installing MXNet, you can install the GluonNLP toolkit by | ||
|
||
.. code-block:: console | ||
pip install gluonnlp | ||
Install from Master Branch | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
If you are interested in trying out features on master branch that hasn't been released yet, | ||
you have the option of installing from master branch directly. | ||
|
||
|
||
Install from GitHub | ||
+++++++++++++++++++ | ||
|
||
Use the following command to automatically download and install the current code on master branch: | ||
|
||
.. code-block:: console | ||
pip install https://github.com/dmlc/gluon-nlp/tarball/master | ||
Install from Source Code | ||
++++++++++++++++++++++++ | ||
|
||
You can also first check out the code locally using Git: | ||
|
||
.. code-block:: console | ||
git clone https://github.com/dmlc/gluon-nlp | ||
cd gluon-nlp | ||
then use the provided `setup.py` to install into site-packages: | ||
|
||
.. code-block:: console | ||
python setup.py install | ||
.. note:: | ||
------------ | ||
|
||
You may need to use `sudo` in case you run into permission denied error. | ||
.. Ignore prerequisites to make the index page concise, which will be shown at | ||
the install page | ||
.. raw:: html | ||
|
||
Alternatively, you can set up the package with development mode, so that local changes are | ||
immediately reflected in the installed python package | ||
<style>.admonition-prerequisite {display: none;}</style> | ||
|
||
.. code-block:: console | ||
.. include:: install/install-include.rst | ||
|
||
python setup.py develop | ||
.. raw:: html | ||
|
||
.. note:: | ||
<style>.disabled { display: none; }</style> | ||
<script type="text/javascript" src='_static/install-options.js'></script> | ||
|
||
The master branch may rely on MXNet nightly builds which are available on PyPI, | ||
please refer to `this page <http://beta.mxnet.io/install.html>`_ for installation guide. | ||
Check :doc:`install/install-more` for more installation instructions and options. |
Oops, something went wrong.