Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mylinde committed May 6, 2024
1 parent 435b869 commit a4edcf8
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 13 deletions.
2 changes: 2 additions & 0 deletions client/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
<span class="popuptext" id="gpt4">{{_('gpt4')}}</span>
<span class="popuptext" id="llama">{{_('llama2')}}</span>
<span class="popuptext" id="mixtral">{{_('mixtral')}}</span>
<span class="popuptext" id="phi">{{_('phi')}}</span>
<span class="popuptext" id="gemma">{{_('gemma')}}</span>
</div>
<div class="field" style="display: none;">
<span>{{_('Provider')}}</span>
Expand Down
2 changes: 1 addition & 1 deletion client/html/index.min.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="height=device-height,width=device-width,initial-scale=1,maximum-scale=5,viewport-fit=cover,interactive-widget=resizes-visual" mobileAppIOS="true"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="full-screen" content="yes"> <meta name="screen-orientation" content="portrait"> <meta name="color-scheme" content="dark light"> <meta name="theme-color" content="#181818" media="(prefers-color-scheme:dark)"> <script>"serviceWorker"in navigator&&window.addEventListener("load",(()=>{navigator.serviceWorker.register("{{ url_for('bp.static', filename='js/serviceworker.min.js') }}")}))</script> <meta name="description" content="A conversational AI system that listens, learns, and challenges"> <link rel="manifest" href="{{ url_for('bp.static', filename='img/site.webmanifest') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/global.min.css') }}"> <link rel="stylesheet" rel="preload" href="{{ url_for('bp.static', filename='css/main.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/round.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/katex.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/texmath.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/hljs.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/conversation.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/message.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/stop-generating.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/typing.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/checkbox.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/label.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/button.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/dropdown.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/field.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/select.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/settings.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/message-input.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/sidebar.min.css') }}"> <link rel="icon" href="{{ url_for('bp.static', filename='img/favicon.ico') }}" media="(prefers-color-scheme:dark)"> <link rel="icon" href="{{ url_for('bp.static', filename='img/favicon-light.ico') }}" media="(prefers-color-scheme:light)"> <title>FreeGPT</title> </head> <body data-urlprefix="{{ url_prefix}}"> <div class="main-container"> <div class="box sidebar"> <button class="button" id="sidebar-button" onclick="new_conversation()"> <span class="material-icons-round">add</span> <span>{{_('New Conversation')}}</span> </button> <div class="top"> </div> <div class="sidebar-footer"> <div class="settings-container"> <div class="popup"> <span class="popuptext" id="gpt3">{{_('gpt')}}</span> <span class="popuptext" id="gpt4">{{_('gpt4')}}</span> <span class="popuptext" id="llama">{{_('llama2')}}</span> <span class="popuptext" id="mixtral">{{_('mixtral')}}</span> </div> <div class="field" style="display:none"> <span>{{_('Provider')}}</span> <select class="dropdown" name="provider" id="provider"> <option value="g4f.Provider.Auto">Auto</option> </select> </div> <div class="field"> <span>{{_('Model')}}</span> <span class="material-icons-round model-info" onmouseenter="showModelInfo()" onmouseleave="showModelInfo()">info</span> </div> <div class="field checkbox"> <span>{{_('Web Access')}}</span> <input type="checkbox" id="switch"> </div> </div> <a class="info" href="https://github.com/Mylinde/freegpt" target="_blank"> <span id="version">FreeGPT {{_('Version')}} 1.0 </span> </a> </div> </div> <div class="conversation"> <span id="pdf-button" class="material-icons-round">picture_as_pdf</span> <span id="share-button" class="material-icons-round">share</span> <div class="stop-generating stop-generating-hidden"> <button class="button" id="cancelButton"> <span>{{_('Stop Generating')}}</span> </button> </div> <div class="user-input"> <div class="box input-box"> <textarea id="message-input" placeholder="{{_('Ask a question')}}" cols="30" rows="10" style="white-space:pre-wrap"></textarea> <div id="send-button"> <span class="material-icons-round">send</span> </div> </div> </div> </div> <div class="menu-button"> <span class="material-icons-round">menu</span> </div> <script>window.conversation_id="{{ chat_id }}"</script> <script src="{{ url_for('bp.static', filename='js/theme-toggler.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/markdown-it.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/katex.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/texmath.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/highlight.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/highlightjs-copy.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/scale.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/purify.min.js') }}"></script> <script type="module" src="{{ url_for('bp.static', filename='js/jspdf.umd.min.js') }}"></script> <script type="module" src="{{ url_for('bp.static', filename='js/assistant.regular-normal.min.js') }}"></script> <script type="module" src="{{ url_for('bp.static', filename='js/assistant.kursiv-normal.min.js') }}"></script> <script rel="preload" src="{{ url_for('bp.static', filename='js/chat.min.js') }}" defer></script> <script src="{{ url_for('bp.static', filename='js/sidebar-toggler.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/change-language.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/provider-sort.min.js') }}"></script> </div>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="height=device-height,width=device-width,initial-scale=1,maximum-scale=5,viewport-fit=cover,interactive-widget=resizes-visual" mobileAppIOS="true"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="full-screen" content="yes"> <meta name="screen-orientation" content="portrait"> <meta name="color-scheme" content="dark light"> <meta name="theme-color" content="#181818" media="(prefers-color-scheme:dark)"> <script>"serviceWorker"in navigator&&window.addEventListener("load",(()=>{navigator.serviceWorker.register("{{ url_for('bp.static', filename='js/serviceworker.min.js') }}")}))</script> <meta name="description" content="A conversational AI system that listens, learns, and challenges"> <link rel="manifest" href="{{ url_for('bp.static', filename='img/site.webmanifest') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/global.min.css') }}"> <link rel="stylesheet" rel="preload" href="{{ url_for('bp.static', filename='css/main.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/round.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/katex.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/texmath.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/hljs.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/conversation.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/message.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/stop-generating.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/typing.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/checkbox.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/label.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/button.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/dropdown.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/field.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/select.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/settings.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/message-input.min.css') }}"> <link rel="stylesheet" href="{{ url_for('bp.static', filename='css/sidebar.min.css') }}"> <link rel="icon" href="{{ url_for('bp.static', filename='img/favicon.ico') }}" media="(prefers-color-scheme:dark)"> <link rel="icon" href="{{ url_for('bp.static', filename='img/favicon-light.ico') }}" media="(prefers-color-scheme:light)"> <title>FreeGPT</title> </head> <body data-urlprefix="{{ url_prefix}}"> <div class="main-container"> <div class="box sidebar"> <button class="button" id="sidebar-button" onclick="new_conversation()"> <span class="material-icons-round">add</span> <span>{{_('New Conversation')}}</span> </button> <div class="top"> </div> <div class="sidebar-footer"> <div class="settings-container"> <div class="popup"> <span class="popuptext" id="gpt3">{{_('gpt')}}</span> <span class="popuptext" id="gpt4">{{_('gpt4')}}</span> <span class="popuptext" id="llama">{{_('llama2')}}</span> <span class="popuptext" id="mixtral">{{_('mixtral')}}</span> <span class="popuptext" id="phi">{{_('phi')}}</span> <span class="popuptext" id="gemma">{{_('gemma')}}</span> </div> <div class="field" style="display:none"> <span>{{_('Provider')}}</span> <select class="dropdown" name="provider" id="provider"> <option value="g4f.Provider.Auto">Auto</option> </select> </div> <div class="field"> <span>{{_('Model')}}</span> <span class="material-icons-round model-info" onmouseenter="showModelInfo()" onmouseleave="showModelInfo()">info</span> </div> <div class="field checkbox"> <span>{{_('Web Access')}}</span> <input type="checkbox" id="switch"> </div> </div> <a class="info" href="https://github.com/Mylinde/freegpt" target="_blank"> <span id="version">FreeGPT {{_('Version')}} 1.0 </span> </a> </div> </div> <div class="conversation"> <span id="pdf-button" class="material-icons-round">picture_as_pdf</span> <span id="share-button" class="material-icons-round">share</span> <div class="stop-generating stop-generating-hidden"> <button class="button" id="cancelButton"> <span>{{_('Stop Generating')}}</span> </button> </div> <div class="user-input"> <div class="box input-box"> <textarea id="message-input" placeholder="{{_('Ask a question')}}" cols="30" rows="10" style="white-space:pre-wrap"></textarea> <div id="send-button"> <span class="material-icons-round">send</span> </div> </div> </div> </div> <div class="menu-button"> <span class="material-icons-round">menu</span> </div> <script>window.conversation_id="{{ chat_id }}"</script> <script src="{{ url_for('bp.static', filename='js/theme-toggler.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/markdown-it.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/katex.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/texmath.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/highlight.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/highlightjs-copy.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/scale.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/purify.min.js') }}"></script> <script type="module" src="{{ url_for('bp.static', filename='js/jspdf.umd.min.js') }}"></script> <script type="module" src="{{ url_for('bp.static', filename='js/assistant.regular-normal.min.js') }}"></script> <script type="module" src="{{ url_for('bp.static', filename='js/assistant.kursiv-normal.min.js') }}"></script> <script rel="preload" src="{{ url_for('bp.static', filename='js/chat.min.js') }}" defer></script> <script src="{{ url_for('bp.static', filename='js/sidebar-toggler.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/change-language.min.js') }}"></script> <script src="{{ url_for('bp.static', filename='js/provider-sort.min.js') }}"></script> </div>
39 changes: 33 additions & 6 deletions client/js/provider-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const modelDisplayNameMapping = {
'gpt-3.5-turbo': 'GPT-3.5 Turbo',
'llama3-8b': 'LLaMA3',
'mixtral-8x7b': 'Mixtral',
'phi-3-mini': 'Phi-3-mini'
'phi-3-mini': 'Phi-3-mini',
'gemma-1.1-7b-it': 'Gemma'
};

const providerDisplayNameMapping = {
Expand All @@ -27,11 +28,11 @@ function updateModelOptions() {
const selectedProvider = providerSelect.value;

if (selectedProvider === 'g4f.Provider.Auto') {
availableModels.push('gpt-3.5-turbo', 'gpt-4', 'llama3-8b', 'mixtral-8x7b', 'phi-3-mini');
availableModels.push('gpt-3.5-turbo', 'gpt-4', 'llama3-8b', 'mixtral-8x7b', 'phi-3-mini', 'gemma-1.1-7b-it');
} else if (selectedProvider === 'g4f.Provider.Liaobots') {
availableModels.push('gpt-3.5-turbo', 'gpt-4');
} else if (selectedProvider === 'g4f.Provider.HuggingFace') {
availableModels.push('mixtral-8x7b', 'llama3-8b', 'phi-3-mini');
availableModels.push('mixtral-8x7b', 'llama3-8b', 'phi-3-mini', 'gemma-1.1-7b-it');
}

let modelSelect = document.getElementById('model');
Expand Down Expand Up @@ -59,6 +60,8 @@ function updateProviderOptions() {
availableProviders.push('g4f.Provider.HuggingFace');
} else if (selectedModel === 'phi-3-mini') {
availableProviders.push('g4f.Provider.HuggingFace');
} else if (selectedModel === 'gemma-1.1-7b-it') {
availableProviders.push('g4f.Provider.HuggingFace');
}

let providerSelect = document.getElementById('provider');
Expand All @@ -85,26 +88,50 @@ const gpt3 = document.getElementById("gpt3");
const gpt4 = document.getElementById("gpt4");
const llama = document.getElementById("llama");
const mixtral = document.getElementById("mixtral");
const phi = document.getElementById("phi");
const gemma = document.getElementById("gemma");

if (selectedModel === 'gpt-3.5-turbo') {
gpt4.classList.remove("show");
llama .classList.remove("show");
mixtral.classList.remove("show");
gpt3.classList.toggle("show");
phi.classList.remove("show");
gemma.classList.remove("show");
gpt3.classList.toggle("show");
} if (selectedModel === 'gpt-4') {
gpt3.classList.remove("show");
llama.classList.remove("show");
mixtral.classList.remove("show");
phi.classList.remove("show");
gemma.classList.remove("show");
gpt4.classList.toggle("show");
} if (selectedModel === 'llama3-8b') {
gpt3.classList.remove("show");
gpt4.classList.remove("show");
mixtral.classList.remove("show");
phi.classList.remove("show");
gemma.classList.remove("show");
llama.classList.toggle("show");
} if (selectedModel === 'mixtral-8x7b') {
gpt3.classList.remove("show");
gpt4.classList.remove("show");
mixtral.classList.toogle("show");
llama.classList.remove("show");
phi.classList.remove("show");
gemma.classList.remove("show");
llama.classList.remove("show");
mixtral.classList.toggle("show");
} if (selectedModel === 'phi-3-mini') {
gpt3.classList.remove("show");
gpt4.classList.remove("show");
gemma.classList.remove("show");
llama.classList.remove("show");
mixtral.classList.remove("show");
phi.classList.toggle("show");
} if (selectedModel === 'gemma-1.1-7b-it') {
gpt3.classList.remove("show");
gpt4.classList.remove("show");
llama.classList.remove("show");
mixtral.classList.remove("show");
phi.classList.remove("show");
gemma.classList.toggle("show");
}
};
Loading

0 comments on commit a4edcf8

Please sign in to comment.