Skip to content

Commit

Permalink
Remove duplicated text model, improve text type detection
Browse files Browse the repository at this point in the history
krassowski committed Oct 8, 2023
1 parent 4eb4bdd commit 8c0a4aa
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -153,7 +153,14 @@ class TransformersInlineProvider implements IInlineCompletionProvider {
request: CompletionHandler.IRequest,
context: IInlineCompletionContext
): Promise<IInlineCompletionList<IInlineCompletionItem>> {
const textMimeTypes = ['text/x-markdown', 'text/plain'];
const textMimeTypes = [
'text/x-ipythongfm',
'text/x-markdown',
'text/plain',
'text/x-rst',
'text/x-latex',
'text/x-rsrc'
];
const isText = textMimeTypes.includes(request.mimeType);
// TODO add a setting to only invoke on text if explicitly asked (triggerKind = invoke)
const model = isText ? this._settings.textModel : this._settings.codeModel;
4 changes: 0 additions & 4 deletions src/models.ts
Original file line number Diff line number Diff line change
@@ -79,10 +79,6 @@ export const textModels: IModelInfo[] = [
repo: 'Xenova/distilgpt2',
licence: 'apache-2.0'
},
{
repo: 'Xenova/distilgpt2',
licence: 'apache-2.0'
},
{
repo: 'Xenova/llama-160m',
licence: 'other'

0 comments on commit 8c0a4aa

Please sign in to comment.