Better temperature (Anthropic from 0 to 1)

This commit is contained in:
Adrien Bouvais 2024-08-14 14:47:54 +02:00
parent 9d76a49b18
commit 1d535f0db9
2 changed files with 35 additions and 3 deletions

View File

@ -18,7 +18,7 @@
[X] Add Nvidia NIM
[ ] Add login with email and password
[ ] Add login with AppleID
[ ] Better temperature settings. (Anthropic from 0-1, OpenAI from 0-2, DeepSeek from -2-2, ect)
[X] Better temperature settings. (Anthropic from 0-1, OpenAI from 0-2, DeepSeek from -2-2, ect)
[X] Auto update the modelsInfos db (At least remove unavailable models and send me an email when new one arrive)
[ ] Encrypt the API keys

View File

@ -64,7 +64,7 @@
placeholder="Model name"
autocomplete="off">
<div class="select is-fullwidth is-small mb-3" id="model-id-input">
<select name="selectedLLMId">
<select name="selectedLLMId" id="modelID-select">
{% for modelInfo in ModelInfos %}
<option value="{{ modelInfo.ModelID }}">
{{ modelInfo.Company.Name }} - {{ modelInfo.Name }}
@ -100,7 +100,7 @@
<input class="slider is-small mb-3"
step="0.05"
min="0"
max="2"
max="1"
value="0"
type="range"
id="temperature-slider"
@ -143,6 +143,19 @@
</div>
</div>
<script>
const companyTempMinMaxValues = {
'openai': { min: 0, max: 2 },
'anthropic': { min: 0, max: 1 },
'deepseek': { min: 0, max: 2 },
'fireworks': { min: 0, max: 2 },
'google': { min: 0, max: 2 },
'groq': { min: 0, max: 2 },
'mistral': { min: 0, max: 2 },
'nim': { min: 0, max: 2 },
'perplexity': { min: 0, max: 2 },
'together': { min: 0, max: 2 },
};
var sortable = new Sortable(document.getElementById('llm-list'), {
animation: 150,
onEnd: function (evt) {
@ -161,6 +174,25 @@
}
});
document.getElementById('modelID-select').addEventListener('change', handleSelectChange)
function handleSelectChange() {
const selectElement = document.getElementById('modelID-select');
const selectedOption = selectElement.options[selectElement.selectedIndex];
const selectedText = selectedOption.innerHTML;
if (selectedText != "Custom Endpoints") {
const companyName = selectedText.split(' - ')[0].trim();
var companyMinMax = companyTempMinMaxValues[companyName];
} else {
var companyMinMax = companyTempMinMaxValues['openai'];
}
var tempSlider = document.getElementById('temperature-slider');
tempSlider.setAttribute("min", companyMinMax.min.toString());
tempSlider.setAttribute("max", companyMinMax.max.toString());
}
document.getElementById('model-name-input').addEventListener('input', function () {
document.getElementById('confirm-create-model-button').disabled = this.value === '' || !document.getElementById('endpoint-error').classList.contains('is-hidden');
})