fix: add missing adaption map
#9
by
bwang0911
- opened
- custom_st.py +3 -0
custom_st.py
CHANGED
@@ -64,6 +64,9 @@ class Transformer(nn.Module):
|
|
64 |
raise ValueError(
|
65 |
f"`lora_adaptations` must be a list and contain at least one element"
|
66 |
)
|
|
|
|
|
|
|
67 |
|
68 |
if max_seq_length is not None and "model_max_length" not in tokenizer_args:
|
69 |
tokenizer_args["model_max_length"] = max_seq_length
|
|
|
64 |
raise ValueError(
|
65 |
f"`lora_adaptations` must be a list and contain at least one element"
|
66 |
)
|
67 |
+
self._adaptation_map = {
|
68 |
+
name: idx for idx, name in enumerate(self._lora_adaptations)
|
69 |
+
}
|
70 |
|
71 |
if max_seq_length is not None and "model_max_length" not in tokenizer_args:
|
72 |
tokenizer_args["model_max_length"] = max_seq_length
|