@@ -105,7 +105,7 @@ impl OllamaClient {
105
105
}
106
106
}
107
107
} ;
108
- log:: info!( "Found local Ollama models: {:#?}" , local_models ) ;
108
+ log:: info!( "Found local Ollama models: {local_models :#?}" ) ;
109
109
110
110
// check external models & pull them if available
111
111
// iterate over models and remove bad ones
@@ -114,13 +114,13 @@ impl OllamaClient {
114
114
for model in models. iter ( ) {
115
115
// pull the model if it is not in the local models
116
116
if !local_models. contains ( & model. to_string ( ) ) {
117
- log:: warn!( "Model {} not found in Ollama" , model ) ;
117
+ log:: warn!( "Model {model } not found in Ollama" ) ;
118
118
if self . auto_pull {
119
119
self . try_pull ( model)
120
120
. await
121
121
. wrap_err ( "could not pull model" ) ?;
122
122
} else {
123
- log:: error!( "Please download missing model with: ollama pull {}" , model ) ;
123
+ log:: error!( "Please download missing model with: ollama pull {model}" ) ;
124
124
log:: error!( "Or, set OLLAMA_AUTO_PULL=true to pull automatically." ) ;
125
125
eyre:: bail!( "required model not pulled in Ollama" ) ;
126
126
}
@@ -145,7 +145,7 @@ impl OllamaClient {
145
145
if models. is_empty ( ) {
146
146
log:: warn!( "No Ollama models passed the performance test! Try using a more powerful machine OR smaller models." ) ;
147
147
} else {
148
- log:: info!( "Ollama checks are finished, using models: {:#?}" , models ) ;
148
+ log:: info!( "Ollama checks are finished, using models: {models :#?}" ) ;
149
149
}
150
150
151
151
Ok ( model_performances)
@@ -155,10 +155,7 @@ impl OllamaClient {
155
155
async fn try_pull ( & self , model : & Model ) -> Result < ollama_rs:: models:: pull:: PullModelStatus > {
156
156
// TODO: add pull-bar here
157
157
// if auto-pull is enabled, pull the model
158
- log:: info!(
159
- "Downloading missing model {} (this may take a while)" ,
160
- model
161
- ) ;
158
+ log:: info!( "Downloading missing model {model} (this may take a while)" ) ;
162
159
self . ollama_rs_client
163
160
. pull_model ( model. to_string ( ) , false )
164
161
. await
@@ -173,10 +170,10 @@ impl OllamaClient {
173
170
const TEST_PROMPT : & str = "Please write a poem about Kapadokya." ;
174
171
const WARMUP_PROMPT : & str = "Write a short poem about hedgehogs and squirrels." ;
175
172
176
- log:: info!( "Testing model {}" , model ) ;
173
+ log:: info!( "Measuring {model}" ) ;
177
174
178
175
// run a dummy generation for warm-up
179
- log:: debug!( "Warming up Ollama for model {}" , model ) ;
176
+ log:: debug!( "Warming up Ollama for {model}" ) ;
180
177
if let Err ( err) = self
181
178
. ollama_rs_client
182
179
. generate ( GenerationRequest :: new (
@@ -185,7 +182,7 @@ impl OllamaClient {
185
182
) )
186
183
. await
187
184
{
188
- log:: warn!( "Ignoring model {model}: {err}" ) ;
185
+ log:: warn!( "Ignoring {model}: {err}" ) ;
189
186
return SpecModelPerformance :: ExecutionFailed ;
190
187
}
191
188
@@ -199,7 +196,7 @@ impl OllamaClient {
199
196
)
200
197
. await
201
198
else {
202
- log:: warn!( "Ignoring model {model}: Timed out" ) ;
199
+ log:: warn!( "Ignoring {model}: Timed out" ) ;
203
200
return SpecModelPerformance :: Timeout ;
204
201
} ;
205
202
@@ -211,18 +208,17 @@ impl OllamaClient {
211
208
* 1_000_000_000f64 ;
212
209
213
210
if tps >= PERFORMANCE_MIN_TPS {
214
- log:: info!( "Model {model} passed the test with tps: {tps}" ) ;
211
+ log:: info!( "{model} passed the test with tps: {tps}" ) ;
215
212
SpecModelPerformance :: PassedWithTPS ( tps)
216
213
} else {
217
214
log:: warn!(
218
- "Ignoring model {model}: tps too low ({tps:.3} < {:.3})" ,
219
- PERFORMANCE_MIN_TPS
215
+ "Ignoring {model}: tps too low ({tps:.3} < {PERFORMANCE_MIN_TPS:.3})"
220
216
) ;
221
217
SpecModelPerformance :: FailedWithTPS ( tps)
222
218
}
223
219
}
224
220
Err ( err) => {
225
- log:: warn!( "Ignoring model {model} due to: {err}" ) ;
221
+ log:: warn!( "Ignoring {model} due to: {err}" ) ;
226
222
SpecModelPerformance :: ExecutionFailed
227
223
}
228
224
}
0 commit comments