@@ -4,8 +4,6 @@ import { autocomplete } from './autocomplete';
44import { preparePrompt } from './preparePrompt' ;
55import { AsyncLock } from '../modules/lock' ;
66import { isNotNeeded , isSupported } from './filter' ;
7- import { ollamaCheckModel } from '../modules/ollamaCheckModel' ;
8- import { ollamaDownloadModel } from '../modules/ollamaDownloadModel' ;
97import { config } from '../config' ;
108
119type Status = {
@@ -104,42 +102,12 @@ export class PromptProvider implements vscode.InlineCompletionItemProvider {
104102 // Result
105103 let res : string | null = null ;
106104
107- // Config
108- let inferenceConfig = config . inference ;
109-
110- // Update status
111- this . update ( 'sync~spin' , 'Llama Coder' ) ;
112- try {
113-
114- // Check model exists
115- let modelExists = await ollamaCheckModel ( inferenceConfig . endpoint , inferenceConfig . modelName , inferenceConfig . bearerToken ) ;
116- if ( token . isCancellationRequested ) {
117- info ( `Canceled after AI completion.` ) ;
118- return ;
119- }
120-
121- // Download model if not exists
122- if ( ! modelExists ) {
123-
124- // Check if user asked to ignore download
125- if ( this . context . globalState . get ( 'llama-coder-download-ignored' ) === inferenceConfig . modelName ) {
126- info ( `Ingoring since user asked to ignore download.` ) ;
127- return ;
128- }
129-
130- // Ask for download
131- let download = await vscode . window . showInformationMessage ( `Model ${ inferenceConfig . modelName } is not downloaded. Do you want to download it? Answering "No" would require you to manually download model.` , 'Yes' , 'No' ) ;
132- if ( download === 'No' ) {
133- info ( `Ingoring since user asked to ignore download.` ) ;
134- this . context . globalState . update ( 'llama-coder-download-ignored' , inferenceConfig . modelName ) ;
135- return ;
136- }
137-
138- // Perform download
139- this . update ( 'sync~spin' , 'Downloading' ) ;
140- await ollamaDownloadModel ( inferenceConfig . endpoint , inferenceConfig . modelName , inferenceConfig . bearerToken ) ;
141- this . update ( 'sync~spin' , 'Llama Coder' ) ;
142- }
105+ // Config
106+ let inferenceConfig = config . inference ;
107+
108+ // Update status
109+ this . update ( 'sync~spin' , 'Llama Coder' ) ;
110+ try {
143111 if ( token . isCancellationRequested ) {
144112 info ( `Canceled after AI completion.` ) ;
145113 return ;
@@ -159,9 +127,9 @@ export class PromptProvider implements vscode.InlineCompletionItemProvider {
159127 canceled : ( ) => token . isCancellationRequested ,
160128 } ) ;
161129 info ( `AI completion completed: ${ res } ` ) ;
162- } finally {
163- this . update ( 'chip' , 'Llama Coder' ) ;
164- }
130+ } finally {
131+ this . update ( 'chip' , 'Llama Coder' ) ;
132+ }
165133 if ( token . isCancellationRequested ) {
166134 info ( `Canceled after AI completion.` ) ;
167135 return ;
0 commit comments