Merge pull request 'main' (#53) from React-Group/interstellar_ai:main into main

Reviewed-on: https://interstellardevelopment.org/code/code/YasinOnm08/interstellar_ai/pulls/53
This commit is contained in:
YasinOnm08 2024-10-08 15:33:54 +02:00
commit 42a61bae02
17 changed files with 53 additions and 131 deletions

View file

@ -11,22 +11,13 @@ const Credits: React.FC = () => {
This project utilizes the following icon resources: This project utilizes the following icon resources:
</p> </p>
<a <a
href="https://www.svgrepo.com/author/Solar%20Icons/" href="https://fontawesome.com/v4/license/"
className="credit-btn" className="credit-btn"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
Solar Icons fontawesome
</a> </a>
<a
href="https://www.svgrepo.com/author/Dazzle%20UI/"
className="credit-btn"
target="_blank"
rel="noopener noreferrer"
>
Dazzle UI
</a>
<h2 className="subtitle">Fonts</h2> <h2 className="subtitle">Fonts</h2>
<p className="paragraph"> <p className="paragraph">
The fonts used in this project are provided by: The fonts used in this project are provided by:

View file

@ -34,7 +34,6 @@ const Header: React.FC<HeaderProps> = ({
// Effect to handle clicks outside of the dropdown // Effect to handle clicks outside of the dropdown
useEffect(() => { useEffect(() => {
const handleClickOutside = (event: MouseEvent) => { const handleClickOutside = (event: MouseEvent) => {
// Check if the click is outside both the dropdown and the hamburger menu
if ( if (
dropdownRef.current && dropdownRef.current &&
!dropdownRef.current.contains(event.target as Node) && !dropdownRef.current.contains(event.target as Node) &&
@ -57,7 +56,19 @@ const Header: React.FC<HeaderProps> = ({
<header> <header>
{showToggle && showHistoryModelsToggle && ( {showToggle && showHistoryModelsToggle && (
<button onClick={toggleDivs} className="nav-btn show-hide-btn"> <button onClick={toggleDivs} className="nav-btn show-hide-btn">
{showDivs ? 'Hide' : 'Show'} {showDivs ? (
<>
<svg style={{ fill: "var(--text-color)" }} width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
<path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"/>
</svg>
</>
) : (
<>
<svg style={{ fill: "var(--text-color)" }} width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/>
</svg>
</>
)}
</button> </button>
)} )}
<nav ref={dropdownRef} className={`nav-links ${menuOpen ? "active" : ""}`}> <nav ref={dropdownRef} className={`nav-links ${menuOpen ? "active" : ""}`}>

View file

@ -8,132 +8,84 @@ const modelList = {
Math: 'qwen2-math:1.5b', Math: 'qwen2-math:1.5b',
Code: 'starcoder2', Code: 'starcoder2',
Language: 'llama3.2', Language: 'llama3.2',
Character: 'dolphin-phi',
Finance: 'qwen2-math:1.5b',
Weather: 'llama3.2', Weather: 'llama3.2',
Time: 'llama3.2',
Image: 'llava-phi3'
}, },
'Offline Slow': { 'Offline Slow': {
model_type: 'local', model_type: 'local',
Math: 'wizard-math', Math: 'wizard-math',
Code: 'starcoder2:7b', Code: 'starcoder2:7b',
Language: 'llama3.1', Language: 'llama3.1',
Character: 'dolphin-llama3',
Finance: 'wizard-math',
Weather: 'llama3.1', Weather: 'llama3.1',
Time: 'llama3.1',
Image: 'llava'
}, },
'Offline Fast (FOSS)': { 'Offline Fast (FOSS)': {
model_type: 'local', model_type: 'local',
Math: 'qwen2-math:1.5b', Math: 'qwen2-math:1.5b',
Code: 'qwen2.5-coder:1.5b', Code: 'qwen2.5-coder:1.5b',
Language: 'phi3.5', Language: 'phi3.5',
Character: 'dolphin-mistral',
Finance: 'qwen2-math:1.5b',
Weather: 'phi3.5', Weather: 'phi3.5',
Time: 'phi3.5',
Image: 'llava'
}, },
'Offline Slow (FOSS)': { 'Offline Slow (FOSS)': {
model_type: 'local', model_type: 'local',
Math: 'mathstral', Math: 'mathstral',
Code: 'qwen2.5-coder', Code: 'qwen2.5-coder',
Language: 'qwen2.5', Language: 'qwen2.5',
Character: 'dolphin-mistral',
Finance: 'mathstral',
Weather: 'qwen2.5', Weather: 'qwen2.5',
Time: 'qwen2.5',
Image: 'llava'
}, },
'Online Cheap (OpenAI)': { 'Online Cheap (OpenAI)': {
model_type: 'openai', model_type: 'openai',
Math: 'gpt-4o-mini', Math: 'gpt-4o-mini',
Code: 'gpt-4o-mini', Code: 'gpt-4o-mini',
Language: 'gpt-4o-mini', Language: 'gpt-4o-mini',
Character: 'gpt-4o-mini',
Finance: 'gpt-4o-mini',
Weather: 'gpt-4o-mini', Weather: 'gpt-4o-mini',
Time: 'gpt-4o-mini',
Image: 'gpt-4o-mini'
}, },
'Online Expensive (OpenAI)': { 'Online Expensive (OpenAI)': {
model_type: 'openai', model_type: 'openai',
Math: 'gpt-4o', Math: 'gpt-4o',
Code: 'gpt-4o', Code: 'gpt-4o',
Language: 'gpt-4o', Language: 'gpt-4o',
Character: 'gpt-4o',
Finance: 'gpt-4o',
Weather: 'gpt-4o', Weather: 'gpt-4o',
Time: 'gpt-4o',
Image: 'gpt-4o'
}, },
'Online Cheap (Anthropic)': { 'Online Cheap (Anthropic)': {
model_type: 'anthropic', model_type: 'anthropic',
Math: 'claude-3-haiku', Math: 'claude-3-haiku',
Code: 'claude-3-haiku', Code: 'claude-3-haiku',
Language: 'claude-3-haiku', Language: 'claude-3-haiku',
Character: 'claude-3-haiku',
Finance: 'claude-3-haiku',
Weather: 'claude-3-haiku', Weather: 'claude-3-haiku',
Time: 'claude-3-haiku',
Image: 'claude-3-haiku'
}, },
'Online Expensive (Anthropic)': { 'Online Expensive (Anthropic)': {
model_type: 'anthropic', model_type: 'anthropic',
Math: 'claude-3-5-sonnet', Math: 'claude-3-5-sonnet',
Code: 'claude-3-5-sonnet', Code: 'claude-3-5-sonnet',
Language: 'claude-3-5-sonnet', Language: 'claude-3-5-sonnet',
Character: 'claude-3-5-sonnet',
Finance: 'claude-3-5-sonnet',
Weather: 'claude-3-5-sonnet', Weather: 'claude-3-5-sonnet',
Time: 'claude-3-5-sonnet',
Image: 'claude-3-5-sonnet'
}, },
'Online Cheap (Google)': { 'Online Cheap (Google)': {
model_type: 'google', model_type: 'google',
Math: 'gemini-1.5-flash-latest', Math: 'gemini-1.5-flash-latest',
Code: 'gemini-1.5-flash-latest', Code: 'gemini-1.5-flash-latest',
Language: 'gemini-1.5-flash-latest', Language: 'gemini-1.5-flash-latest',
Character: 'gemini-1.5-flash-latest',
Finance: 'gemini-1.5-flash-latest',
Weather: 'gemini-1.5-flash-latest', Weather: 'gemini-1.5-flash-latest',
Time: 'gemini-1.5-flash-latest',
Image: 'gemini-1.5-flash-latest'
}, },
'Online Expensive (Google)': { 'Online Expensive (Google)': {
model_type: 'google', model_type: 'google',
Math: 'gemini-1.5-pro-latest', Math: 'gemini-1.5-pro-latest',
Code: 'gemini-1.5-pro-latest', Code: 'gemini-1.5-pro-latest',
Language: 'gemini-1.5-pro-latest', Language: 'gemini-1.5-pro-latest',
Character: 'gemini-1.5-pro-latest',
Finance: 'gemini-1.5-pro-latest',
Weather: 'gemini-1.5-pro-latest', Weather: 'gemini-1.5-pro-latest',
Time: 'gemini-1.5-pro-latest',
Image: 'gemini-1.5-pro-latest'
}, },
'Online (La Plateforme)': { 'Online (La Plateforme)': {
model_type: 'mistral', model_type: 'mistral',
Math: 'open-mistral-nemo', Math: 'open-mistral-nemo',
Code: 'codestral-latest', Code: 'codestral-latest',
Language: 'mistral-small-latest', Language: 'mistral-small-latest',
Character: 'mistral-large-latest',
Finance: 'open-mistral-nemo',
Weather: 'mistral-small-latest', Weather: 'mistral-small-latest',
Time: 'mistral-small-latest',
Image: 'pixtral-12b-2409'
}, },
'Online (FOSS) (La Plateforme)': { 'Online (FOSS) (La Plateforme)': {
model_type: 'mistral', model_type: 'mistral',
Math: 'open-mistral-nemo', Math: 'open-mistral-nemo',
Code: 'open-codestral-mamba', Code: 'open-codestral-mamba',
Language: 'open-mistral-nemo', Language: 'open-mistral-nemo',
Character: 'open-mixtral-8x22b',
Finance: 'open-mixtral-8x22b',
Weather: 'open-mistral-nemo', Weather: 'open-mistral-nemo',
Time: 'open-mistral-nemo',
Image: 'pixtral-12b-2409'
} }
} }
@ -158,13 +110,7 @@ const selectedAIFunction = [
'Code', 'Code',
'Math', 'Math',
'Language', 'Language',
'Character', 'Weather'
'Finance',
'Weather',
'Time',
'Image',
'Custom1',
'Custom2'
] ]
const ModelSection: React.FC = () => { const ModelSection: React.FC = () => {

View file

@ -46,8 +46,10 @@ header {
background-color: var(--burger-menu-background-color); background-color: var(--burger-menu-background-color);
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: center;
padding: 10px; justify-content: center;
padding: 10px auto;
margin: auto;
} }
.nav-links.active { .nav-links.active {
@ -61,11 +63,11 @@ header {
font-size: 0.9em; font-size: 0.9em;
height: 50px; /* Consistent height */ height: 50px; /* Consistent height */
border-radius: 5px; border-radius: 5px;
padding: 10px; padding: 10px auto;
font-family: var(--font-family); font-family: var(--font-family);
width: 100%; /* Full width */ width: 100%; /* Full width */
text-align: center; /* Center text */ text-align: center; /* Center text */
margin: 4px; margin: 4px auto;
} }
.nav-btn:hover { .nav-btn:hover {
@ -116,6 +118,8 @@ header {
} }
.show-hide-btn{ .show-hide-btn{
display: flex;
align-items: center;
width: fit-content; width: fit-content;
align-self: left; align-self: left;
position: absolute; position: absolute;

View file

@ -119,21 +119,6 @@
background-position: center; background-position: center;
} }
.character-model {
background-image: url(/img/character.jpg);
background-color: #72cce4;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
.finance-model {
background-image: url(/img/financial.jpg);
background-color: #72cce4;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
.weather-model { .weather-model {
background-image: url(/img/weather.jpg); background-image: url(/img/weather.jpg);
@ -143,22 +128,6 @@
background-position: center; background-position: center;
} }
.time-model {
background-image: url(/img/time.jpg);
background-color: #72cce4;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
.image-model {
background-image: url(/img/image.jpg);
background-color: #72cce4;
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
.custom1-model, .custom1-model,
.custom2-model { .custom2-model {
background-image: url(/img/default.jpg); background-image: url(/img/default.jpg);

View file

@ -1,3 +1,3 @@
start /b scripts\prepare_py.bat start /b scripts\prepare_py.bat
start /b scripts\prepare_npm.bat start /b scripts\prepare_npm.bat
start /b scripts\prepare_ollama.bat start /b scripts\prepare_ollama_free.bat

View file

@ -0,0 +1,3 @@
start /b scripts\prepare_py.bat
start /b scripts\prepare_npm.bat
start /b scripts\prepare_ollama_nonfree.bat

View file

@ -1,19 +0,0 @@
cd ollama-bin
start /b ollama.exe serve
timeout 5
ollama.exe pull phi3.5
ollama.exe pull qwen2-math:1.5b
ollama.exe pull starcoder2
ollama.exe pull llava-phi3
ollama.exe pull qwen2.5-coder:1.5b
ollama.exe pull starcoder2:7b
ollama.exe pull wizard-math
ollama.exe pull llama3.1
ollama.exe pull llama3.2
ollama.exe pull dolphin-phi
ollama.exe pull dolphin-llama3
ollama.exe pull dolphin-mistral
ollama.exe pull llava
ollama.exe pull qwen2.5
ollama.exe pull mathstral
ollama.exe pull qwen2.5-coder

View file

@ -0,0 +1,10 @@
cd ollama-bin
start /b ollama.exe serve
timeout 5
ollama.exe pull qwen2-math:1.5b
ollama.exe pull qwen2.5-coder:1.5b
ollama.exe pull phi3.5
ollama.exe pull mathstral
ollama.exe pull qwen2.5-coder
ollama.exe pull qwen2.5

View file

@ -0,0 +1,10 @@
cd ollama-bin
start /b ollama.exe serve
timeout 5
ollama.exe pull qwen2-math:1.5b
ollama.exe pull starcoder2
ollama.exe pull llama3.2
ollama.exe pull wizard-math
ollama.exe pull starcoder2:7b
ollama.exe pull llama3.1

View file

@ -1,7 +1,7 @@
cd python-bin cd python-bin
set PATH=%PATH%;"%CD%"; set PATH=%PATH%;"%CD%";
curl -O https://bootstrap.pypa.io/get-pip.py curl -O https://bootstrap.pypa.io/get-pip.py
ren python py ren python.exe py.exe
py get-pip.py py get-pip.py
cd Scripts cd Scripts
set PATH=%PATH%;"%CD%"; set PATH=%PATH%;"%CD%";
@ -9,4 +9,5 @@ cd ..
cd .. cd ..
cd py cd py
py -m pip install setuptools
py -m pip install -r requirements.txt py -m pip install -r requirements.txt

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

View file

@ -5,14 +5,10 @@ mistralai
openai openai
anthropic anthropic
pyOpenSSL pyOpenSSL
SpeechRecognition
PocketSphinx
google-cloud-speech
google-generativeai google-generativeai
python-weather python-weather
pycouchdb pycouchdb
pyttsx3 pyttsx3
pip-licenses
faster-whisper faster-whisper
pydub pydub
ffmpeg ffmpeg