Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit b951426

Browse files
authored
fix: change helper function to private (#151)
* fix: change helper function to private * docs: fix ecosystem sidebar
1 parent 370e5fb commit b951426

11 files changed

Lines changed: 90 additions & 15 deletions

File tree

docs/_static/finetuner-light.svg

Lines changed: 7 additions & 0 deletions
Loading

docs/_static/hub-light.svg

Lines changed: 13 additions & 0 deletions
Loading

docs/_static/main.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,15 @@ table code {
9494

9595
.usage-card {
9696
display: none;
97+
}
98+
99+
.sidebar-ecosys-logo {
100+
width: 1.2em;
101+
margin-right: .5em;
102+
}
103+
104+
/*temp fix on diff size*/
105+
.sidebar-ecosys-logo-finetuner {
106+
width: 1em;
107+
margin-right: .7em;
97108
}

docs/_static/search-light.svg

Lines changed: 14 additions & 0 deletions
Loading

docs/_templates/sidebar/brand.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
2+
{% block brand_content %}
3+
{%- if logo_url %}
4+
<div class="sidebar-logo-container">
5+
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
6+
</div>
7+
{%- endif %}
8+
{%- if theme_light_logo and theme_dark_logo %}
9+
<div class="sidebar-logo-container">
10+
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
11+
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
12+
</div>
13+
{%- endif %}
14+
<div class="sd-text-center">
15+
<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>
16+
</div>
17+
{% if not theme_sidebar_hide_name %}
18+
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
19+
{%- endif %}
20+
{% endblock brand_content %}
21+
</a>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="sidebar-tree">
2+
{{ furo_navigation_tree }}
3+
<p class="caption" role="heading"><span class="caption-text">Ecosystem</span></p>
4+
<ul>
5+
<li class="toctree-l1">
6+
<a class="reference external" href="https://docs.jina.ai"><img class="sidebar-ecosys-logo" src="{{ pathto('_static/search-light.svg', 1) }}">Jina</a></li>
7+
<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>
8+
<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>
9+
</ul>
10+
</div>

docs/components/tuner.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Here, `embed_model` must be an {term}`embedding model`; and `train_data` must be
2424

2525
### Loss function
2626

27+
Loss function is an argument of `finetuner.fit()`.
28+
2729
By default, Tuner uses `CosineSiameseLoss` for training. You can also use other built-in losses by `finetuner.fit(..., loss='...')`.
2830

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

194+
## Save model
195+
196+
After a model is tuned, you can save it by calling `finetuner.tuner.save(model, save_path)`.
197+
192198

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
184184
gtag('config', 'G-1ESRNDCK35');
185185
</script>
186+
<!-- Place this tag in your head or just before your close body tag. -->
187+
<script async defer src="https://buttons.github.io/buttons.js"></script>
186188
''',
187189
]
188190

docs/index.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,6 @@ components/index
278278
api/finetuner
279279
```
280280

281-
282-
```{toctree}
283-
:caption: Ecosystem
284-
:hidden:
285-
286-
Jina <https://github.com/jina-ai/jina>
287-
Jina Hub <https://hub.jina.ai>
288-
```
289-
290281
---
291282
{ref}`genindex` {ref}`modindex`
292283

0 commit comments

Comments
 (0)