This commit is contained in:
2024-05-31 12:15:28 +02:00
parent bf361851aa
commit 183244e07b
4 changed files with 50 additions and 18 deletions
+10 -3
View File
@@ -50,9 +50,12 @@
{% for modelInfo in ModelInfos %}
<option value="{{ modelInfo.ModelID }}">{{ modelInfo.ModelID }}</option>
{% endfor %}
{% if IsSub %}<option value="custom">Inference Endpoints</option> {% endif %}
<option value="{% if IsSub %}custom{% else %}none{% endif %}">Inference Endpoints</option>
</select>
</div>
<p class="is-hidden" style="color: red;" id="endpoint-error"></p>
<small>You can only use custom endpoint if you are a subscriber</small>
</p>
<input class="input is-small mb-3 is-hidden" type="text" id="model-cid-input" name="model-cid-input"
placeholder="Model id" autocomplete="off">
<input class="input is-small mb-3 is-hidden" type="text" id="model-url-input" name="model-url-input"
@@ -103,8 +106,6 @@
}
});
document.getElementById('model-name-input').addEventListener('input', function () {
document.getElementById('confirm-create-model-button').disabled = this.value === '';
})
@@ -120,6 +121,12 @@
document.getElementById('model-url-input').classList.toggle('is-hidden', !customEndpoint);
document.getElementById('model-key-input').classList.toggle('is-hidden', !customEndpoint);
document.getElementById('model-cid-input').classList.toggle('is-hidden', !customEndpoint);
if (this.value === 'none') {
document.getElementById('endpoint-error').classList.remove('is-hidden');
} else {
document.getElementById('endpoint-error').classList.add('is-hidden');
}
});
document.getElementById('temperature-slider').addEventListener('input', function () {