Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into release/1.2.3; version bump and dependency
Browse files Browse the repository at this point in the history
update
  • Loading branch information
hans committed Mar 26, 2021
2 parents 8530bb4 + c7c8022 commit c9b17a4
Show file tree
Hide file tree
Showing 16 changed files with 769 additions and 532 deletions.
806 changes: 429 additions & 377 deletions Pipfile.lock

Large diffs are not rendered by default.

111 changes: 89 additions & 22 deletions docs/_sources/models.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,94 @@ Official models
LM Zoo ships with a set of official models that can be queried via the
command-line tool.

If you reference any of the model names mentioned here, LM Zoo will
automatically download the relevant image from our public registry. For
example, to get token-level predictions from the ``tinylstm`` model on a file
``my_file.txt``::

$ lm-zoo get-predictions tinylstm my_file.text out.hdf5

Note that not all models support all LM Zoo features. Check the final columns
of the table to see if the features you need are supported in each model.



Do you develop language models? please see our instructions on :ref:`contributing`.

Model list
^^^^^^^^^^^

+------------------------+---------------------------------+---------------------------------------------------+
| Model name | Reference | Paper |
+========================+=================================+===================================================+
| GPT-2-XL | Radford et al. (2019) | https://openai.com/blog/better-language-models/ |
+------------------------+---------------------------------+---------------------------------------------------+
| GPT-2 | Radford et al. (2019) | https://openai.com/blog/better-language-models/ |
+------------------------+---------------------------------+---------------------------------------------------+
| Transformer-XL | Dai et al. (2019) | https://www.aclweb.org/anthology/P19-1285/ |
+------------------------+---------------------------------+---------------------------------------------------+
| JRNN | Josefowicz et al. (2016) | https://arxiv.org/abs/1602.02410 |
+------------------------+---------------------------------+---------------------------------------------------+
| GRNN | Gulordava et al. (2018) | https://www.aclweb.org/anthology/N18-1108/ |
+------------------------+---------------------------------+---------------------------------------------------+
| RNNG | Dyer et al. (2016) | https://arxiv.org/abs/1602.07776 |
+------------------------+---------------------------------+---------------------------------------------------+
| LSTM | Hochreiter & Schmidhuber (1997) | https://dl.acm.org/doi/10.1162/neco.1997.9.8.1735 |
+------------------------+---------------------------------+---------------------------------------------------+
| Ordered-Neurons | Shen et al. (2019) | https://openreview.net/forum?id=B1l6qiR5F7 |
+------------------------+---------------------------------+---------------------------------------------------+

.. raw:: html

<script type="text/javascript">
var registry_url = "https://cpllab.github.io/lm-zoo/registry.json";
var all_features = {
"tokenize": "<tt>tokenize</tt>",
"unkify": "<tt>unkify</tt>",
"get_surprisals": "<tt>get-surprisals</tt>",
"get_predictions": "<tt>get-predictions</tt>",
"mount_checkpoint": "Checkpoint mounting",
}
$(function(){
// Update feature list
var all_features_list = Object.keys(all_features);
$("#registry-feature-header").attr("colspan", all_features_list.length);
var registry_feature_list_htmls = $.map(all_features_list, function(name) {
var pretty_name = all_features[name];
return "<th id='feature-" + name + "' scope='col'>" + pretty_name + "</th>";
})
$("#registry-feature-list").html(registry_feature_list_htmls.join(""));
$.getJSON(registry_url, function(data) {
var items = $.map(data, function(registry_item, id) {
var reference_link = "<a href='" + registry_item["ref_url"] + "'>Link</a>";
var size_str;
var size = registry_item["image"]["size"] / 1024;
var next_size = size / 1024;
var labels = ["KB", "MB", "GB"];
var label_cur = 0;
while (next_size > 1024) {
size = next_size;
next_size = size / 1024;
label_cur += 1;
}
var round = function(x) { return Math.round(x * 100) / 100; }
var size_str = label_cur == labels.length - 1 ? round(size) + " " + labels[labels.length - 1]
: round(next_size) + " " + labels[label_cur + 1];
var columns = [id, reference_link, size_str,
new Date(Date.parse(registry_item["image"]["datetime"])).toLocaleDateString()];
var feature_columns = $.map(all_features_list, function(feature) {
var supported = registry_item["image"]["supported_features"][feature];
var td_class = supported ? "feature-supported" : "feature-unsupported";
var content = supported ? "Yes" : "No";
return "<td class='" + td_class + "'>" + content + "</td>";
});
return "<tr><td>" + columns.join("</td><td>") + "</td>" + feature_columns.join("") + "</tr>";
});
console.log(items.join(""))
$("#registry-table tbody").html(items.join(""));
//$("#registry-table tbody").html($("#registry-table tbody").html() + items.join(""))
})});
</script>

<table id="registry-table">
<thead>
<tr>
<th rowspan="2" scope="col">Model name</th>
<th rowspan="2" scope="col">Reference</th>
<th rowspan="2" scope="col">Size</th>
<th rowspan="2" scope="col">Last updated</th>
<th id="registry-feature-header" colspan="5" scope="colgroup">Supported features</th>
</tr>
<tr id="registry-feature-list">
<!--<th>1</th><th>2</th><th><tt>3</tt></th><th>4</th><th>5</th>-->
</tr>
</thead>
<tbody></tbody>
</table>
136 changes: 84 additions & 52 deletions docs/models.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

<ul>

<li class="toctree-l2"><a href="#model-list" class="reference internal">Model list</a></li>
<li class="toctree-l2"><a href="#official-models" class="reference internal">Official models</a></li>

</ul>

Expand Down Expand Up @@ -197,58 +197,90 @@
<h1>Official models<a class="headerlink" href="#official-models" title="Permalink to this headline"></a></h1>
<p>LM Zoo ships with a set of official models that can be queried via the
command-line tool.</p>
<p>Do you develop language models? please see our instructions on <a class="reference internal" href="contributing.html#contributing"><span class="std std-ref">Contributing to the LM Zoo</span></a>.</p>
<div class="section" id="model-list">
<h2>Model list<a class="headerlink" href="#model-list" title="Permalink to this headline"></a></h2>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 31%" />
<col style="width: 47%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Model name</p></th>
<th class="head"><p>Reference</p></th>
<th class="head"><p>Paper</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>GPT-2-XL</p></td>
<td><p>Radford et al. (2019)</p></td>
<td><p><a class="reference external" href="https://openai.com/blog/better-language-models/">https://openai.com/blog/better-language-models/</a></p></td>
</tr>
<tr class="row-odd"><td><p>GPT-2</p></td>
<td><p>Radford et al. (2019)</p></td>
<td><p><a class="reference external" href="https://openai.com/blog/better-language-models/">https://openai.com/blog/better-language-models/</a></p></td>
</tr>
<tr class="row-even"><td><p>Transformer-XL</p></td>
<td><p>Dai et al. (2019)</p></td>
<td><p><a class="reference external" href="https://www.aclweb.org/anthology/P19-1285/">https://www.aclweb.org/anthology/P19-1285/</a></p></td>
</tr>
<tr class="row-odd"><td><p>JRNN</p></td>
<td><p>Josefowicz et al. (2016)</p></td>
<td><p><a class="reference external" href="https://arxiv.org/abs/1602.02410">https://arxiv.org/abs/1602.02410</a></p></td>
</tr>
<tr class="row-even"><td><p>GRNN</p></td>
<td><p>Gulordava et al. (2018)</p></td>
<td><p><a class="reference external" href="https://www.aclweb.org/anthology/N18-1108/">https://www.aclweb.org/anthology/N18-1108/</a></p></td>
</tr>
<tr class="row-odd"><td><p>RNNG</p></td>
<td><p>Dyer et al. (2016)</p></td>
<td><p><a class="reference external" href="https://arxiv.org/abs/1602.07776">https://arxiv.org/abs/1602.07776</a></p></td>
</tr>
<tr class="row-even"><td><p>LSTM</p></td>
<td><p>Hochreiter &amp; Schmidhuber (1997)</p></td>
<td><p><a class="reference external" href="https://dl.acm.org/doi/10.1162/neco.1997.9.8.1735">https://dl.acm.org/doi/10.1162/neco.1997.9.8.1735</a></p></td>
</tr>
<tr class="row-odd"><td><p>Ordered-Neurons</p></td>
<td><p>Shen et al. (2019)</p></td>
<td><p><a class="reference external" href="https://openreview.net/forum?id=B1l6qiR5F7">https://openreview.net/forum?id=B1l6qiR5F7</a></p></td>
</tr>
</tbody>
</table>
</div>
<p>If you reference any of the model names mentioned here, LM Zoo will
automatically download the relevant image from our public registry. For
example, to get token-level predictions from the <code class="docutils literal notranslate"><span class="pre">tinylstm</span></code> model on a file
<code class="docutils literal notranslate"><span class="pre">my_file.txt</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ lm-zoo get-predictions tinylstm my_file.text out.hdf5
</pre></div>
</div>
<p>Note that not all models support all LM Zoo features. Check the final columns
of the table to see if the features you need are supported in each model.</p>
<p>Do you develop language models? please see our instructions on <a class="reference internal" href="contributing.html#contributing"><span class="std std-ref">Contributing to the LM Zoo</span></a>.</p>
<script type="text/javascript">
var registry_url = "https://cpllab.github.io/lm-zoo/registry.json";

var all_features = {
"tokenize": "<tt>tokenize</tt>",
"unkify": "<tt>unkify</tt>",
"get_surprisals": "<tt>get-surprisals</tt>",
"get_predictions": "<tt>get-predictions</tt>",
"mount_checkpoint": "Checkpoint mounting",
}

$(function(){

// Update feature list
var all_features_list = Object.keys(all_features);
$("#registry-feature-header").attr("colspan", all_features_list.length);
var registry_feature_list_htmls = $.map(all_features_list, function(name) {
var pretty_name = all_features[name];
return "<th id='feature-" + name + "' scope='col'>" + pretty_name + "</th>";
})
$("#registry-feature-list").html(registry_feature_list_htmls.join(""));

$.getJSON(registry_url, function(data) {
var items = $.map(data, function(registry_item, id) {
var reference_link = "<a href='" + registry_item["ref_url"] + "'>Link</a>";

var size_str;
var size = registry_item["image"]["size"] / 1024;
var next_size = size / 1024;
var labels = ["KB", "MB", "GB"];
var label_cur = 0;
while (next_size > 1024) {
size = next_size;
next_size = size / 1024;
label_cur += 1;
}
var round = function(x) { return Math.round(x * 100) / 100; }
var size_str = label_cur == labels.length - 1 ? round(size) + " " + labels[labels.length - 1]
: round(next_size) + " " + labels[label_cur + 1];

var columns = [id, reference_link, size_str,
new Date(Date.parse(registry_item["image"]["datetime"])).toLocaleDateString()];

var feature_columns = $.map(all_features_list, function(feature) {
var supported = registry_item["image"]["supported_features"][feature];
var td_class = supported ? "feature-supported" : "feature-unsupported";
var content = supported ? "Yes" : "No";
return "<td class='" + td_class + "'>" + content + "</td>";
});

return "<tr><td>" + columns.join("</td><td>") + "</td>" + feature_columns.join("") + "</tr>";
});
console.log(items.join(""))

$("#registry-table tbody").html(items.join(""));
//$("#registry-table tbody").html($("#registry-table tbody").html() + items.join(""))
})});
</script>

<table id="registry-table">
<thead>
<tr>
<th rowspan="2" scope="col">Model name</th>
<th rowspan="2" scope="col">Reference</th>
<th rowspan="2" scope="col">Size</th>
<th rowspan="2" scope="col">Last updated</th>
<th id="registry-feature-header" colspan="5" scope="colgroup">Supported features</th>
</tr>
<tr id="registry-feature-list">
<!--<th>1</th><th>2</th><th><tt>3</tt></th><th>4</th><th>5</th>-->
</tr>
</thead>
<tbody></tbody>
</table></div>


</div>
Expand Down
111 changes: 89 additions & 22 deletions docs/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,94 @@ Official models
LM Zoo ships with a set of official models that can be queried via the
command-line tool.

If you reference any of the model names mentioned here, LM Zoo will
automatically download the relevant image from our public registry. For
example, to get token-level predictions from the ``tinylstm`` model on a file
``my_file.txt``::

$ lm-zoo get-predictions tinylstm my_file.text out.hdf5

Note that not all models support all LM Zoo features. Check the final columns
of the table to see if the features you need are supported in each model.



Do you develop language models? please see our instructions on :ref:`contributing`.

Model list
^^^^^^^^^^^

+------------------------+---------------------------------+---------------------------------------------------+
| Model name | Reference | Paper |
+========================+=================================+===================================================+
| GPT-2-XL | Radford et al. (2019) | https://openai.com/blog/better-language-models/ |
+------------------------+---------------------------------+---------------------------------------------------+
| GPT-2 | Radford et al. (2019) | https://openai.com/blog/better-language-models/ |
+------------------------+---------------------------------+---------------------------------------------------+
| Transformer-XL | Dai et al. (2019) | https://www.aclweb.org/anthology/P19-1285/ |
+------------------------+---------------------------------+---------------------------------------------------+
| JRNN | Josefowicz et al. (2016) | https://arxiv.org/abs/1602.02410 |
+------------------------+---------------------------------+---------------------------------------------------+
| GRNN | Gulordava et al. (2018) | https://www.aclweb.org/anthology/N18-1108/ |
+------------------------+---------------------------------+---------------------------------------------------+
| RNNG | Dyer et al. (2016) | https://arxiv.org/abs/1602.07776 |
+------------------------+---------------------------------+---------------------------------------------------+
| LSTM | Hochreiter & Schmidhuber (1997) | https://dl.acm.org/doi/10.1162/neco.1997.9.8.1735 |
+------------------------+---------------------------------+---------------------------------------------------+
| Ordered-Neurons | Shen et al. (2019) | https://openreview.net/forum?id=B1l6qiR5F7 |
+------------------------+---------------------------------+---------------------------------------------------+

.. raw:: html

<script type="text/javascript">
var registry_url = "https://cpllab.github.io/lm-zoo/registry.json";
var all_features = {
"tokenize": "<tt>tokenize</tt>",
"unkify": "<tt>unkify</tt>",
"get_surprisals": "<tt>get-surprisals</tt>",
"get_predictions": "<tt>get-predictions</tt>",
"mount_checkpoint": "Checkpoint mounting",
}
$(function(){
// Update feature list
var all_features_list = Object.keys(all_features);
$("#registry-feature-header").attr("colspan", all_features_list.length);
var registry_feature_list_htmls = $.map(all_features_list, function(name) {
var pretty_name = all_features[name];
return "<th id='feature-" + name + "' scope='col'>" + pretty_name + "</th>";
})
$("#registry-feature-list").html(registry_feature_list_htmls.join(""));
$.getJSON(registry_url, function(data) {
var items = $.map(data, function(registry_item, id) {
var reference_link = "<a href='" + registry_item["ref_url"] + "'>Link</a>";
var size_str;
var size = registry_item["image"]["size"] / 1024;
var next_size = size / 1024;
var labels = ["KB", "MB", "GB"];
var label_cur = 0;
while (next_size > 1024) {
size = next_size;
next_size = size / 1024;
label_cur += 1;
}
var round = function(x) { return Math.round(x * 100) / 100; }
var size_str = label_cur == labels.length - 1 ? round(size) + " " + labels[labels.length - 1]
: round(next_size) + " " + labels[label_cur + 1];
var columns = [id, reference_link, size_str,
new Date(Date.parse(registry_item["image"]["datetime"])).toLocaleDateString()];
var feature_columns = $.map(all_features_list, function(feature) {
var supported = registry_item["image"]["supported_features"][feature];
var td_class = supported ? "feature-supported" : "feature-unsupported";
var content = supported ? "Yes" : "No";
return "<td class='" + td_class + "'>" + content + "</td>";
});
return "<tr><td>" + columns.join("</td><td>") + "</td>" + feature_columns.join("") + "</tr>";
});
console.log(items.join(""))
$("#registry-table tbody").html(items.join(""));
//$("#registry-table tbody").html($("#registry-table tbody").html() + items.join(""))
})});
</script>

<table id="registry-table">
<thead>
<tr>
<th rowspan="2" scope="col">Model name</th>
<th rowspan="2" scope="col">Reference</th>
<th rowspan="2" scope="col">Size</th>
<th rowspan="2" scope="col">Last updated</th>
<th id="registry-feature-header" colspan="5" scope="colgroup">Supported features</th>
</tr>
<tr id="registry-feature-list">
<!--<th>1</th><th>2</th><th><tt>3</tt></th><th>4</th><th>5</th>-->
</tr>
</thead>
<tbody></tbody>
</table>
Loading

0 comments on commit c9b17a4

Please sign in to comment.