@@ -108,7 +108,7 @@ def models_cache_dir(request):
108108
109109### Fixtures for grabbing a randomly initialized model to test interfaces against
110110## Causal LM
111- @pytest .fixture
111+ @pytest .fixture ( scope = "session" )
112112def causal_lm_train_kwargs ():
113113 """Get the kwargs for a valid train call to a Causal LM."""
114114 model_kwargs = {
@@ -124,15 +124,15 @@ def causal_lm_train_kwargs():
124124 return model_kwargs
125125
126126
127- @pytest .fixture
127+ @pytest .fixture ( scope = "session" )
128128def causal_lm_dummy_model (causal_lm_train_kwargs ):
129129 """Train a Causal LM dummy model."""
130130 return caikit_nlp .modules .text_generation .PeftPromptTuning .train (
131131 ** causal_lm_train_kwargs
132132 )
133133
134134
135- @pytest .fixture
135+ @pytest .fixture ( scope = "session" )
136136def saved_causal_lm_dummy_model (causal_lm_dummy_model ):
137137 """Give a path to a saved dummy model that can be loaded"""
138138 with tempfile .TemporaryDirectory () as workdir :
@@ -142,7 +142,7 @@ def saved_causal_lm_dummy_model(causal_lm_dummy_model):
142142
143143
144144## Seq2seq
145- @pytest .fixture
145+ @pytest .fixture ( scope = "session" )
146146def seq2seq_lm_train_kwargs ():
147147 """Get the kwargs for a valid train call to a Causal LM."""
148148 model_kwargs = {
@@ -158,7 +158,7 @@ def seq2seq_lm_train_kwargs():
158158 return model_kwargs
159159
160160
161- @pytest .fixture
161+ @pytest .fixture ( scope = "session" )
162162def seq2seq_lm_dummy_model (seq2seq_lm_train_kwargs ):
163163 """Train a Seq2Seq LM dummy model."""
164164 return caikit_nlp .modules .text_generation .PeftPromptTuning .train (
0 commit comments