fixed ci idents

inlinecompletion_update
Stéphane Tetsing 1 year ago
parent 1f4a10537b
commit 3ea6f6d37b
  1. 1
      apps/remix-ide/src/app/plugins/copilot/suggestion-service/worker.js
  2. 49
      apps/remix-ide/src/app/plugins/solcoderAI.tsx
  3. 2
      libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts

@ -3,7 +3,6 @@ import { pipeline, env } from '@xenova/transformers';
env.allowLocalModels = true; env.allowLocalModels = true;
const instance = null
/** /**
* This class uses the Singleton pattern to ensure that only one instance of the pipeline is loaded. * This class uses the Singleton pattern to ensure that only one instance of the pipeline is loaded.
*/ */

@ -74,31 +74,30 @@ export class SolCoder extends Plugin {
try { try {
result = await( result = await(
await fetch(this.api_url.concat("code_completion"), { await fetch(this.api_url.concat("code_completion"), {
method: 'POST', method: 'POST',
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data": !options? [ body: JSON.stringify({"data": !options? [
prompt, // string in 'context_code' Textbox component prompt, // string in 'context_code' Textbox component
"", // string in 'comment' Textbox component "", // string in 'comment' Textbox component
false, // boolean in 'stream_result' Checkbox component false, // boolean in 'stream_result' Checkbox component
200, // number (numeric value between 0 and 2000) in 'max_new_tokens' Slider component 200, // number (numeric value between 0 and 2000) in 'max_new_tokens' Slider component
0.9, // number (numeric value between 0.01 and 1) in 'temperature' Slider component 0.9, // number (numeric value between 0.01 and 1) in 'temperature' Slider component
0.90, // number (numeric value between 0 and 1) in 'top_p' Slider component 0.90, // number (numeric value between 0 and 1) in 'top_p' Slider component
50, // number (numeric value between 1 and 200) in 'top_k' Slider component 50, // number (numeric value between 1 and 200) in 'top_k' Slider component
] : [ ] : [
prompt, prompt,
"", "",
options.stream_result, options.stream_result,
options.max_new_tokens, options.max_new_tokens,
options.temperature, options.temperature,
options.top_p, options.top_p,
options.top_k options.top_k
] ]}),
}), })
}) ).json()
).json()
return result.data return result.data
} catch (e) { } catch (e) {

@ -82,7 +82,7 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
} }
const generatedText = (result as any).output[0].generated_text as string const generatedText = (result as any).output[0].generated_text as string
let clean = generatedText const clean = generatedText
console.log('solcoder inline data:\n', clean) console.log('solcoder inline data:\n', clean)
const item: monacoTypes.languages.InlineCompletion = { const item: monacoTypes.languages.InlineCompletion = {

Loading…
Cancel
Save