Remove unused code to eliminate build warnings
- Remove unused SYSTEM_PROMPT_FOR_NATIVE_TOOL_USE and SYSTEM_PROMPT_FOR_NON_NATIVE_TOOL_USE constants - Remove unused gpu_layers field from EmbeddedProvider struct - Remove unused clean_stop_sequences method from EmbeddedProvider
This commit is contained in:
@@ -42,8 +42,6 @@ pub struct EmbeddedProvider {
|
||||
temperature: f32,
|
||||
/// Context window size
|
||||
context_length: u32,
|
||||
/// Number of GPU layers
|
||||
gpu_layers: u32,
|
||||
/// Number of threads
|
||||
threads: Option<u32>,
|
||||
}
|
||||
@@ -138,7 +136,6 @@ impl EmbeddedProvider {
|
||||
max_tokens,
|
||||
temperature: temperature.unwrap_or(0.1),
|
||||
context_length: context_size,
|
||||
gpu_layers: n_gpu_layers,
|
||||
threads,
|
||||
})
|
||||
}
|
||||
@@ -341,21 +338,6 @@ impl EmbeddedProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/// Clean stop sequences from generated text.
|
||||
fn clean_stop_sequences(&self, text: &str) -> String {
|
||||
let mut cleaned = text.to_string();
|
||||
let stop_sequences = self.get_stop_sequences();
|
||||
|
||||
for stop_seq in &stop_sequences {
|
||||
if let Some(pos) = cleaned.find(stop_seq) {
|
||||
cleaned.truncate(pos);
|
||||
break; // Only remove the first occurrence to avoid over-truncation
|
||||
}
|
||||
}
|
||||
|
||||
cleaned.trim().to_string()
|
||||
}
|
||||
|
||||
/// Get the effective max tokens for generation
|
||||
fn effective_max_tokens(&self) -> u32 {
|
||||
self.max_tokens
|
||||
|
||||
Reference in New Issue
Block a user