forked from React-Group/interstellar_ai
Models comments
This commit is contained in:
parent
5f017026e2
commit
4caece5108
1 changed files with 5 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
|
||||||
// Define all models that should be available.
|
// Define all models that should be available.
|
||||||
|
//#region modelist
|
||||||
const modelList = {
|
const modelList = {
|
||||||
'Offline Fast': {
|
'Offline Fast': {
|
||||||
model_type: 'local',
|
model_type: 'local',
|
||||||
|
@ -112,7 +113,7 @@ const selectedAIFunction = [
|
||||||
'Language',
|
'Language',
|
||||||
'Weather'
|
'Weather'
|
||||||
]
|
]
|
||||||
|
//#region variables
|
||||||
const ModelSection: React.FC = () => {
|
const ModelSection: React.FC = () => {
|
||||||
// Initialize state with value from localStorage or default to ''
|
// Initialize state with value from localStorage or default to ''
|
||||||
const [selectedModelDropdown, setSelectedModelDropdown] = useState('');
|
const [selectedModelDropdown, setSelectedModelDropdown] = useState('');
|
||||||
|
@ -120,7 +121,7 @@ const ModelSection: React.FC = () => {
|
||||||
const [activeSelectedAIFunction, setActiveSelectedAIFunction] = useState('');
|
const [activeSelectedAIFunction, setActiveSelectedAIFunction] = useState('');
|
||||||
const [currentSelectedAIFunction, setCurrentSelectedAIFunction] = useState<string | null>("");
|
const [currentSelectedAIFunction, setCurrentSelectedAIFunction] = useState<string | null>("");
|
||||||
const [isOpenSourceMode, setIsOpenSourceMode] = useState<string|null>("false")
|
const [isOpenSourceMode, setIsOpenSourceMode] = useState<string|null>("false")
|
||||||
|
//#region functions
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof localStorage !== 'undefined') {
|
if (typeof localStorage !== 'undefined') {
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
|
@ -175,7 +176,7 @@ const ModelSection: React.FC = () => {
|
||||||
modelClicked(model)
|
modelClicked(model)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//#region dropdown
|
||||||
// Determine the filtered models based on current radioSelection
|
// Determine the filtered models based on current radioSelection
|
||||||
const filteredModels = (() => {
|
const filteredModels = (() => {
|
||||||
let models = [];
|
let models = [];
|
||||||
|
@ -241,7 +242,7 @@ const ModelSection: React.FC = () => {
|
||||||
localStorage.setItem("type", modelList[selectedAIFunction]['model_type' as keyof typeof modelList[typeof selectedAIFunction]])
|
localStorage.setItem("type", modelList[selectedAIFunction]['model_type' as keyof typeof modelList[typeof selectedAIFunction]])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//#region return "html"
|
||||||
return (
|
return (
|
||||||
<div className="model-background">
|
<div className="model-background">
|
||||||
<div className="models">
|
<div className="models">
|
||||||
|
|
Loading…
Reference in a new issue