@@ -11,8 +11,8 @@ use crate::{
1111 get_toml_selected_model_dtype,
1212 pipeline:: { GGMLLoaderBuilder , GGMLSpecificConfig , GGUFLoaderBuilder , NormalSpecificConfig } ,
1313 toml_selector:: get_toml_selected_model_device_map_params,
14- AutoDeviceMapParams , DiffusionLoaderBuilder , DiffusionSpecificConfig , GGUFSpecificConfig ,
15- Loader , ModelDType , ModelSelected , NormalLoaderBuilder , TomlLoaderArgs , TomlSelector , Topology ,
14+ AutoDeviceMapParams , DiffusionLoaderBuilder , GGUFSpecificConfig , Loader , ModelDType ,
15+ ModelSelected , NormalLoaderBuilder , TomlLoaderArgs , TomlSelector , Topology ,
1616 VisionLoaderBuilder , VisionSpecificConfig , GGUF_MULTI_FILE_DELIMITER ,
1717 UQFF_MULTI_FILE_DELIMITER ,
1818} ;
@@ -23,7 +23,6 @@ pub struct LoaderBuilder {
2323 no_kv_cache : bool ,
2424 chat_template : Option < String > ,
2525 jinja_explicit : Option < String > ,
26- use_flash_attn : bool ,
2726 prompt_chunksize : Option < NonZeroUsize > ,
2827}
2928
@@ -33,7 +32,6 @@ impl LoaderBuilder {
3332 model,
3433 no_kv_cache : false ,
3534 chat_template : None ,
36- use_flash_attn : false ,
3735 prompt_chunksize : None ,
3836 jinja_explicit : None ,
3937 }
@@ -51,10 +49,6 @@ impl LoaderBuilder {
5149 self . jinja_explicit = jinja_explicit;
5250 self
5351 }
54- pub fn with_use_flash_attn ( mut self , use_flash_attn : bool ) -> Self {
55- self . use_flash_attn = use_flash_attn;
56- self
57- }
5852 pub fn with_prompt_chunksize ( mut self , prompt_chunksize : Option < NonZeroUsize > ) -> Self {
5953 self . prompt_chunksize = prompt_chunksize;
6054 self
@@ -188,15 +182,13 @@ pub fn get_auto_device_map_params(model: &ModelSelected) -> anyhow::Result<AutoD
188182}
189183
190184fn loader_from_model_selected ( args : LoaderBuilder ) -> anyhow:: Result < Box < dyn Loader > > {
191- let use_flash_attn = args. use_flash_attn ;
192185 let loader: Box < dyn Loader > = match args. model {
193186 ModelSelected :: Toml { file } => {
194187 let selector: TomlSelector = toml:: from_str (
195188 & fs:: read_to_string ( file. clone ( ) )
196189 . unwrap_or_else ( |_| panic ! ( "Could not load toml selector file at {file}" ) ) ,
197190 ) ?;
198191 let args = TomlLoaderArgs {
199- use_flash_attn,
200192 chat_template : args. chat_template ,
201193 no_kv_cache : args. no_kv_cache ,
202194 prompt_chunksize : args. prompt_chunksize ,
@@ -220,7 +212,6 @@ fn loader_from_model_selected(args: LoaderBuilder) -> anyhow::Result<Box<dyn Loa
220212 hf_cache_path,
221213 } => NormalLoaderBuilder :: new (
222214 NormalSpecificConfig {
223- use_flash_attn,
224215 prompt_chunksize : args. prompt_chunksize ,
225216 topology : Topology :: from_option_path ( topology) ?,
226217 organization : organization. unwrap_or_default ( ) ,
@@ -258,7 +249,6 @@ fn loader_from_model_selected(args: LoaderBuilder) -> anyhow::Result<Box<dyn Loa
258249 hf_cache_path,
259250 } => NormalLoaderBuilder :: new (
260251 NormalSpecificConfig {
261- use_flash_attn,
262252 prompt_chunksize : args. prompt_chunksize ,
263253 topology : Topology :: from_option_path ( topology) ?,
264254 organization : Default :: default ( ) ,
@@ -303,7 +293,6 @@ fn loader_from_model_selected(args: LoaderBuilder) -> anyhow::Result<Box<dyn Loa
303293 hf_cache_path,
304294 } => NormalLoaderBuilder :: new (
305295 NormalSpecificConfig {
306- use_flash_attn,
307296 prompt_chunksize : args. prompt_chunksize ,
308297 topology : Topology :: from_option_path ( topology) ?,
309298 organization : Default :: default ( ) ,
@@ -526,7 +515,6 @@ fn loader_from_model_selected(args: LoaderBuilder) -> anyhow::Result<Box<dyn Loa
526515 imatrix,
527516 } => VisionLoaderBuilder :: new (
528517 VisionSpecificConfig {
529- use_flash_attn,
530518 prompt_chunksize : args. prompt_chunksize ,
531519 topology : Topology :: from_option_path ( topology) ?,
532520 write_uqff,
@@ -551,10 +539,7 @@ fn loader_from_model_selected(args: LoaderBuilder) -> anyhow::Result<Box<dyn Loa
551539 model_id,
552540 arch,
553541 dtype : _,
554- } => {
555- DiffusionLoaderBuilder :: new ( DiffusionSpecificConfig { use_flash_attn } , Some ( model_id) )
556- . build ( arch)
557- }
542+ } => DiffusionLoaderBuilder :: new ( Some ( model_id) ) . build ( arch) ,
558543 } ;
559544 Ok ( loader)
560545}
0 commit comments