remix desktop sanity check

pull/5100/head
STetsing 2 months ago
parent d37d67e392
commit ed197aa3c2
  1. 10
      apps/remix-ide/src/app/plugins/remixAIPlugin.tsx
  2. 5
      apps/remixdesktop/src/plugins/remixAIDektop.ts

@ -37,15 +37,7 @@ export class RemixAIPlugin extends Plugin {
} }
onActivation(): void { onActivation(): void {
if (this.isOnDesktop) { this.initialize(null, null, null, false)
console.log('Activating RemixAIPlugin on desktop')
this.on(this.remixDesktopPluginName, 'activated', () => {
this.call("remixAI", 'initialize', null, null, null, false);
})
} else {
console.log('Activating RemixAIPlugin on browser')
this.initialize()
}
} }
async initialize(model1?:IModel, model2?:IModel, remoteModel?:IRemoteModel, useRemote?:boolean){ async initialize(model1?:IModel, model2?:IModel, remoteModel?:IRemoteModel, useRemote?:boolean){

@ -40,12 +40,10 @@ class RemixAIDesktopPluginClient extends ElectronBasePluginClient {
desktopInferencer:InferenceManager | RemoteInferencer = null desktopInferencer:InferenceManager | RemoteInferencer = null
constructor (webContentsId: number, profile: Profile){ constructor (webContentsId: number, profile: Profile){
console.log("loading the remix plugin client ........................")
super(webContentsId, profile) super(webContentsId, profile)
} }
async onActivation(): Promise<void> { async onActivation(): Promise<void> {
console.log("Activation", "loaded the remix plugin client application side")
this.onload(() => { this.onload(() => {
}) })
} }
@ -57,16 +55,13 @@ class RemixAIDesktopPluginClient extends ElectronBasePluginClient {
async initializeModelBackend(local, generalModel?, completionModel?){ async initializeModelBackend(local, generalModel?, completionModel?){
if (!local){ if (!local){
console.log('RemixAI remote enpoints')
this.desktopInferencer = new RemoteInferencer() this.desktopInferencer = new RemoteInferencer()
} else if (generalModel || completionModel){ } else if (generalModel || completionModel){
if (!this.desktopInferencer){ if (!this.desktopInferencer){
console.log('RemixAI local enpoints')
this.desktopInferencer = InferenceManager.getInstance(this.modelCacheDir) this.desktopInferencer = InferenceManager.getInstance(this.modelCacheDir)
if (this.desktopInferencer instanceof InferenceManager && generalModel) await this.desktopInferencer.init(generalModel) if (this.desktopInferencer instanceof InferenceManager && generalModel) await this.desktopInferencer.init(generalModel)
if (this.desktopInferencer instanceof InferenceManager && completionModel) await this.desktopInferencer.init(completionModel) if (this.desktopInferencer instanceof InferenceManager && completionModel) await this.desktopInferencer.init(completionModel)
} else { } else {
console.log('Inference model already initialized')
return false // do not set event listener twice return false // do not set event listener twice
} }
} else { } else {

Loading…
Cancel
Save