From c2de5601aa4191c18e1972f5abb873a35eac9f35 Mon Sep 17 00:00:00 2001 From: Rusyaidi Date: Sun, 29 Oct 2023 01:36:39 +0800 Subject: [PATCH] Fixed textgen and mancer issues. --- app/index.js | 16 +++++++++------- components/Endpoint/Mancer.js | 8 +++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/index.js b/app/index.js index eaabd26..2b17222 100644 --- a/app/index.js +++ b/app/index.js @@ -216,7 +216,7 @@ const Home = () => { no_repeat_ngram_size: parseInt(presetTGWUI.no_repeat_ngram_size), num_beams: parseInt(presetTGWUI.num_beams), penalty_alpha: parseFloat(presetTGWUI.penalty_alpha), - length_penalty: parseFloat(presetTGWUI.length_penalt), + length_penalty: parseFloat(presetTGWUI.length_penalty), early_stopping: presetTGWUI.early_stopping, mirostat_mode: parseInt(presetTGWUI.mirostat_mode), mirostat_eta: parseFloat(presetTGWUI.mirostat_eta), @@ -379,14 +379,16 @@ const Home = () => { } const TGWUIReponseStream = async () => { - const check = await fetch(`https://neuro.mancer.tech/webui/${mancerModel.id}/api/v1/model`, { + if(APIType === API.MANCER) { + const check = await fetch(`https://neuro.mancer.tech/webui/${mancerModel?.id}/api/v1/model`, { method: 'GET', headers: {'X-API-KEY': mancerKey} - }) - if(check.status !== 200) { - setNowGenerating(false) - ToastAndroid.show(`Invalid Model or API key!`, 3000) - return + }) + if(check.status !== 200) { + setNowGenerating(false) + ToastAndroid.show(`Invalid Model or API key!`, 3000) + return + } } //return try { diff --git a/components/Endpoint/Mancer.js b/components/Endpoint/Mancer.js index 5a5208b..9085064 100644 --- a/components/Endpoint/Mancer.js +++ b/components/Endpoint/Mancer.js @@ -52,7 +52,9 @@ const Mancer = () => { setKeyInput('') ToastAndroid.show('Key saved!', 2000) }}> - + + + @@ -75,7 +77,7 @@ const Mancer = () => { /> - + {(mancerModel !== undefined) && {mancerModel.name} @@ -92,7 +94,7 @@ const Mancer = () => { : {mancerModel.pricing.prompt} - + } ) }