-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set default to include_context=True * boolq extended dataset for training * improved evals + boolq T/F eval + text-only
- Loading branch information
Showing
6 changed files
with
190 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import re | ||
|
||
from ultravox.evaluation import eval_types | ||
|
||
|
||
def match_last_word(sample: eval_types.Sample) -> eval_types.ExactMatchResult: | ||
last_words = re.findall(r"\b\w+\b(?=\W*$)", sample.generated_answer.lower()) | ||
expected_tf = re.findall(r"\b\w+\b(?=\W*$)", sample.expected_answer.lower())[-1] | ||
|
||
if not last_words: | ||
return eval_types.ExactMatchResult(score=0, reason="No last word found") | ||
|
||
last_word: str = last_words[-1] | ||
if last_word in ["yes", "true"]: | ||
last_word = "true" | ||
elif last_word in ["no", "false"]: | ||
last_word = "false" | ||
else: | ||
return eval_types.ExactMatchResult(score=0, reason="Last word not true/false") | ||
|
||
return eval_types.ExactMatchResult( | ||
score=last_word == expected_tf, reason="exact_match check" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
exp_name: stage2_lora__gs_ai_bq | ||
|
||
text_model_lora_config: | ||
r: 64 # no/little change in the range [16, 64] | ||
target_modules: ['mlp.gate_proj', 'mlp.up_proj', 'mlp.down_proj', 'v_proj', 'o_proj', 'k_proj', 'q_proj'] | ||
|
||
data_sets: ["commonvoice", "peoplespeech", "anyinstruct"] | ||
data_sets: ["gigaspeech", "anyinstruct", "boolq_extended"] | ||
|
||
# disable_layer_drop: True | ||
# audio_model_lora_config: | ||
# r: 64 | ||
# target_modules: ['k_proj', 'q_proj', 'v_proj', 'out_proj', 'intermediate_dense', 'output_dense'] | ||
|
||
num_prompts: 6 | ||
num_prompts: 11 | ||
|
||
lr: 1.e-4 # need a lower LR for LLM fine-tuning | ||
lr_scheduler: constant_with_warmup | ||
lr_warmup_steps: 250 | ||
max_steps: 5_000 | ||
save_steps: 0 | ||
|
||
batch_size: 2 | ||
grad_accum_steps: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters