[fix] fix textgen again
This commit is contained in:
@@ -111,7 +111,8 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
let DURL = db.textgenWebUIURL
|
let DURL = db.textgenWebUIURL
|
||||||
let bodyTemplate:any
|
let bodyTemplate:any
|
||||||
const proompt = stringlizeChat(formated, currentChar.name)
|
const proompt = stringlizeChat(formated, currentChar.name)
|
||||||
if(DURL.includes('api')){
|
const isNewAPI = DURL.includes('api')
|
||||||
|
if(isNewAPI){
|
||||||
bodyTemplate = {
|
bodyTemplate = {
|
||||||
'max_new_tokens': 80,
|
'max_new_tokens': 80,
|
||||||
'do_sample': true,
|
'do_sample': true,
|
||||||
@@ -174,6 +175,12 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
console.log(res.data)
|
console.log(res.data)
|
||||||
if(res.ok){
|
if(res.ok){
|
||||||
try {
|
try {
|
||||||
|
if(isNewAPI){
|
||||||
|
return {
|
||||||
|
type: 'success',
|
||||||
|
result: dat.results[0].text.substring(proompt.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
result: dat.data[0].substring(proompt.length)
|
result: dat.data[0].substring(proompt.length)
|
||||||
|
|||||||
Reference in New Issue
Block a user