Skip to content

Commit

Permalink
fix: change helper function to private (#151)
Browse files Browse the repository at this point in the history
* fix: change helper function to private

* docs: fix ecosystem sidebar
  • Loading branch information
hanxiao committed Oct 19, 2021
1 parent 370e5fb commit b951426
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 15 deletions.
7 changes: 7 additions & 0 deletions docs/_static/finetuner-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/_static/hub-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/_static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,15 @@ table code {

.usage-card {
display: none;
}

.sidebar-ecosys-logo {
width: 1.2em;
margin-right: .5em;
}

/*temp fix on diff size*/
.sidebar-ecosys-logo-finetuner {
width: 1em;
margin-right: .7em;
}
14 changes: 14 additions & 0 deletions docs/_static/search-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/_templates/sidebar/brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
{% block brand_content %}
{%- if logo_url %}
<div class="sidebar-logo-container">
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
<div class="sidebar-logo-container">
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
</div>
{%- endif %}
<div class="sd-text-center">
<a class="github-button" href="https://github.com/jina-ai/finetuner" data-icon="octicon-star" data-show-count="true" aria-label="Star jina-ai/finetuner on GitHub">Star</a>
</div>
{% if not theme_sidebar_hide_name %}
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
{%- endif %}
{% endblock brand_content %}
</a>
10 changes: 10 additions & 0 deletions docs/_templates/sidebar/navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="sidebar-tree">
{{ furo_navigation_tree }}
<p class="caption" role="heading"><span class="caption-text">Ecosystem</span></p>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://docs.jina.ai"><img class="sidebar-ecosys-logo" src="{{ pathto('_static/search-light.svg', 1) }}">Jina</a></li>
<li class="toctree-l1"><a class="reference external" href="https://hub.jina.ai"><img class="sidebar-ecosys-logo" src="{{ pathto('_static/hub-light.svg', 1) }}">Jina Hub</a></li>
<li class="toctree-l1"><a class="reference internal" href="#"><img class="sidebar-ecosys-logo sidebar-ecosys-logo-finetuner" src="{{ pathto('_static/finetuner-light.svg', 1) }}">Finetuner</a></li>
</ul>
</div>
6 changes: 6 additions & 0 deletions docs/components/tuner.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Here, `embed_model` must be an {term}`embedding model`; and `train_data` must be

### Loss function

Loss function is an argument of `finetuner.fit()`.

By default, Tuner uses `CosineSiameseLoss` for training. You can also use other built-in losses by `finetuner.fit(..., loss='...')`.

Let $\mathbf{x}_i$ denotes the predicted embedding for Document $i$. The built-in losses are summarized as follows:
Expand Down Expand Up @@ -189,4 +191,8 @@ Although siamese and triplet loss works on pair and triplet inputs respectively,
:align: center
```

## Save model

After a model is tuned, you can save it by calling `finetuner.tuner.save(model, save_path)`.


2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
gtag('config', 'G-1ESRNDCK35');
</script>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
''',
]

Expand Down
9 changes: 0 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,6 @@ components/index
api/finetuner
```


```{toctree}
:caption: Ecosystem
:hidden:
Jina <https://github.com/jina-ai/jina>
Jina Hub <https://hub.jina.ai>
```

---
{ref}`genindex` {ref}`modindex`

Loading

0 comments on commit b951426

Please sign in to comment.