Skip to content

Commit

Permalink
local_llms
Browse files Browse the repository at this point in the history
  • Loading branch information
rounak610 committed Oct 10, 2023
1 parent 6271d8e commit fea8fc5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gui/pages/Content/Models/ModelForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ export default function ModelForm({internalId, getModels, sendModelData}){

const handleModelStatus = () => {
testModel().then((response) =>{
if(response.data.success)
if(response.status === 200)
{
setModelStatus(true)
}
else
{
setModelStatus(false)
}
}).catch((error) => {
console.log("Error Message:: " + error)
setModelStatus(false)
Expand Down Expand Up @@ -186,18 +190,19 @@ export default function ModelForm({internalId, getModels, sendModelData}){
</div>
</div>}

{modelStatus===true && <div className="horizontal_container align_start error_box mt_24 gap_6">
{modelStatus===true && <div className="horizontal_container align_start success_box mt_24 gap_6">
<Image width={16} height={16} src="/images/icon_info.svg"/>
<div className="vertical_containers">
<span className="text_12 color_white lh_16">Test model successful</span>
</div>
</div>}

<div className="horizontal_container justify_space_between w_100 mt_24">
<button className="secondary_button flex_none" onClick={handleModelStatus}>Test Model</button>
{selectedModel==='Local LLM' && <button className="secondary_button flex_none" onClick={handleModelStatus}>Test Model</button>}
<div className="horizontal_container justify_end">
<button className="secondary_button mr_7"
onClick={() => removeTab(-5, "new model", "Add_Model", internalId)}>Cancel</button>
<button className='primary_button' onClick={handleAddModel} disabled={lockAddition || isLoading}>
<button className='primary_button' onClick={handleAddModel} disabled={lockAddition || isLoading || (selectedModel==='Local LLM' && !modelStatus)}>
{isLoading ? <><span>Adding Model &nbsp;</span><ClipLoader size={16} color={"#000000"} /></> : 'Add Model'}
</button>
</div>
Expand Down
7 changes: 7 additions & 0 deletions gui/pages/_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,13 @@ tr{
padding: 12px;
}

.success_box{
border-radius: 8px;
padding: 12px;
border-left: 4px solid rgba(255, 255, 255, 0.60);
background: rgba(255, 255, 255, 0.08);
}

.horizontal_line {
margin: 16px 0 16px -16px;
border: 1px solid #ffffff20;
Expand Down

0 comments on commit fea8fc5

Please sign in to comment.