@@ -4,8 +4,6 @@ import { autocomplete } from './autocomplete';
4
4
import { preparePrompt } from './preparePrompt' ;
5
5
import { AsyncLock } from '../modules/lock' ;
6
6
import { isNotNeeded , isSupported } from './filter' ;
7
- import { ollamaCheckModel } from '../modules/ollamaCheckModel' ;
8
- import { ollamaDownloadModel } from '../modules/ollamaDownloadModel' ;
9
7
import { config } from '../config' ;
10
8
11
9
type Status = {
@@ -104,42 +102,12 @@ export class PromptProvider implements vscode.InlineCompletionItemProvider {
104
102
// Result
105
103
let res : string | null = null ;
106
104
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 {
143
111
if ( token . isCancellationRequested ) {
144
112
info ( `Canceled after AI completion.` ) ;
145
113
return ;
@@ -159,9 +127,9 @@ export class PromptProvider implements vscode.InlineCompletionItemProvider {
159
127
canceled : ( ) => token . isCancellationRequested ,
160
128
} ) ;
161
129
info ( `AI completion completed: ${ res } ` ) ;
162
- } finally {
163
- this . update ( 'chip' , 'Llama Coder' ) ;
164
- }
130
+ } finally {
131
+ this . update ( 'chip' , 'Llama Coder' ) ;
132
+ }
165
133
if ( token . isCancellationRequested ) {
166
134
info ( `Canceled after AI completion.` ) ;
167
135
return ;
0 commit comments