diff --git a/configs/model/Bielik-7B-Instruct-v0.1-fine-tuned.yaml b/configs/model/Bielik-7B-Instruct-v0.1-fine-tuned.yaml new file mode 100644 index 0000000..f18c78a --- /dev/null +++ b/configs/model/Bielik-7B-Instruct-v0.1-fine-tuned.yaml @@ -0,0 +1,11 @@ +name: speakleash/Bielik-7B-Instruct-v0.1 +tokenizer_name: ${.name} + +adapter_path: data/experiments/fine-tune/Bielik-7B-Instruct-v0.1/pl-court-instruct/checkpoint-1500 + +max_seq_length: 4096 +batch_size: 1 +padding: longest +use_4bit: true + +use_unsloth: true diff --git a/configs/model/Bielik-7B-Instruct-v0.1.yaml b/configs/model/Bielik-7B-Instruct-v0.1.yaml new file mode 100644 index 0000000..a5f1fc9 --- /dev/null +++ b/configs/model/Bielik-7B-Instruct-v0.1.yaml @@ -0,0 +1,11 @@ +name: speakleash/Bielik-7B-Instruct-v0.1 +tokenizer_name: ${.name} + +adapter_path: null + +max_seq_length: 4096 +batch_size: 1 +padding: longest +use_4bit: true + +use_unsloth: true diff --git a/configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml b/configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml index 1cb3a96..4715522 100644 --- a/configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml +++ b/configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml @@ -1,7 +1,7 @@ name: unsloth/Mistral-Nemo-Instruct-2407-bnb-4bit tokenizer_name: ${.name} -adapter_path: data/experiments/fine-tune/Unsloth-Mistral-Nemo-Instruct-2407/pl-court-instruct/checkpoint-500 +adapter_path: data/experiments/fine-tune/Unsloth-Mistral-Nemo-Instruct-2407/pl-court-instruct/checkpoint-1500 max_seq_length: 7_900 # can handle larger inputs, but set is equal to llama-3 for better comparison padding: longest diff --git a/data/experiments/fine-tune/Bielik-7B-Instruct-v0.1/.gitignore b/data/experiments/fine-tune/Bielik-7B-Instruct-v0.1/.gitignore new file mode 100644 index 0000000..c5110ed --- /dev/null +++ b/data/experiments/fine-tune/Bielik-7B-Instruct-v0.1/.gitignore @@ -0,0 +1 @@ +/pl-court-instruct diff --git a/data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/.gitignore b/data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/.gitignore new file mode 100644 index 0000000..579472e --- /dev/null +++ b/data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/.gitignore @@ -0,0 +1,6 @@ +/outputs_42.json +/outputs_7312.json +/outputs_997.json +/metrics_42.json +/metrics_7312.json +/metrics_997.json diff --git a/data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/.gitignore b/data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/.gitignore new file mode 100644 index 0000000..f2e5215 --- /dev/null +++ b/data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/.gitignore @@ -0,0 +1,6 @@ +/outputs_997.json +/outputs_42.json +/outputs_7312.json +/metrics_42.json +/metrics_7312.json +/metrics_997.json diff --git a/data/experiments/predict/pl-court-instruct/metrics_ngram_summary.md b/data/experiments/predict/pl-court-instruct/metrics_ngram_summary.md index b978ad0..ba08914 100644 --- a/data/experiments/predict/pl-court-instruct/metrics_ngram_summary.md +++ b/data/experiments/predict/pl-court-instruct/metrics_ngram_summary.md @@ -1,10 +1,12 @@ | llm | full_text_chrf | court_name | date | department_name | judges | legal_bases | recorder | signature | |:----------------------------------------------|:-----------------|:----------------|:----------------|:------------------|:----------------|:----------------|:----------------|:----------------| +| Bielik-7B-Instruct-v0.1 | 0.354 (± 0.001) | 0.000 (± 0.000) | 0.001 (± 0.000) | 0.001 (± 0.000) | 0.001 (± 0.000) | 0.001 (± 0.000) | 0.000 (± 0.000) | 0.000 (± 0.000) | +| Bielik-7B-Instruct-v0.1-fine-tuned | 0.717 (± 0.000) | 0.890 (± 0.007) | 0.863 (± 0.007) | 0.886 (± 0.007) | 0.879 (± 0.007) | 0.465 (± 0.004) | 0.639 (± 0.001) | 0.459 (± 0.002) | | Unsloth-Llama-3-8B-Instruct | 0.579 (± 0.001) | 0.865 (± 0.000) | 0.948 (± 0.001) | 0.882 (± 0.026) | 0.902 (± 0.011) | 0.312 (± 0.042) | 0.741 (± 0.002) | 0.665 (± 0.022) | | Unsloth-Llama-3-8B-Instruct-fine-tuned | 0.747 (± 0.000) | 0.916 (± 0.001) | 0.920 (± 0.002) | 0.902 (± 0.000) | 0.906 (± 0.001) | 0.442 (± 0.001) | 0.812 (± 0.003) | 0.805 (± 0.004) | | Unsloth-Mistral-7B-Instruct-v0.3 | 0.574 (± 0.001) | 0.397 (± 0.005) | 0.470 (± 0.004) | 0.404 (± 0.005) | 0.424 (± 0.003) | 0.159 (± 0.002) | 0.436 (± 0.003) | 0.159 (± 0.001) | | Unsloth-Mistral-7B-Instruct-v0.3-fine-tuned | 0.634 (± 0.001) | 0.547 (± 0.003) | 0.549 (± 0.003) | 0.543 (± 0.003) | 0.544 (± 0.003) | 0.366 (± 0.002) | 0.534 (± 0.002) | 0.533 (± 0.001) | | Unsloth-Mistral-Nemo-Instruct-2407 | 0.520 (± 0.001) | 0.732 (± 0.006) | 0.759 (± 0.005) | 0.687 (± 0.006) | 0.619 (± 0.006) | 0.267 (± 0.002) | 0.690 (± 0.008) | 0.600 (± 0.004) | -| Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned | 0.610 (± 0.000) | 0.782 (± 0.002) | 0.742 (± 0.000) | 0.717 (± 0.002) | 0.717 (± 0.001) | 0.368 (± 0.000) | 0.696 (± 0.003) | 0.650 (± 0.003) | +| Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned | 0.708 (± 0.001) | 0.900 (± 0.001) | 0.843 (± 0.000) | 0.818 (± 0.001) | 0.826 (± 0.001) | 0.503 (± 0.002) | 0.693 (± 0.007) | 0.642 (± 0.007) | | open_ai_gpt-4o | 0.651 (± nan) | 0.955 (± nan) | 0.986 (± nan) | 0.971 (± nan) | 0.917 (± nan) | 0.502 (± nan) | 0.834 (± nan) | 0.990 (± nan) | | open_ai_gpt-4o-mini | 0.646 (± nan) | 0.953 (± nan) | 0.986 (± nan) | 0.976 (± nan) | 0.927 (± nan) | 0.534 (± nan) | 0.969 (± nan) | 0.988 (± nan) | diff --git a/dvc.lock b/dvc.lock index 32ec7c8..6e0ab30 100644 --- a/dvc.lock +++ b/dvc.lock @@ -342,8 +342,8 @@ stages: size: 7685 - path: data/experiments/predict/pl-court-instruct/metrics_ngram_summary.md hash: md5 - md5: 77cd4feb52b6586a13ef760396beae36 - size: 1623 + md5: c604c03e4266f13c8cd05a007b137419 + size: 2443 evaluate_llm_as_judge@Unsloth-Llama-3-8B-Instruct-Unsloth-Llama-3-8B-Instruct: cmd: PYTHONPATH=. python scripts/sft/evaluate_llm_as_judge.py model=Unsloth-Llama-3-8B-Instruct answers_file=data/experiments/predict/pl-court-instruct/outputs_Unsloth-Llama-3-8B-Instruct.json @@ -1242,8 +1242,8 @@ stages: deps: - path: configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml hash: md5 - md5: e8f88d45940e06207daf1eccb5fb5d8d - size: 351 + md5: a35f354b805d105999797d19d0aa7bde + size: 352 - path: configs/predict.yaml hash: md5 md5: 5fc8b9ac571d4a2209d7d866697252ab @@ -1256,8 +1256,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_42.json hash: md5 - md5: 76924fe96291bafebb4259eb39a14ba3 - size: 1730656 + md5: 14d4613f7d9495f5fb5f2d7b81f402a9 + size: 1825646 predict@Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned-997: cmd: PYTHONPATH=. python scripts/sft/predict.py model=Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned random_seed=997 @@ -1265,8 +1265,8 @@ stages: deps: - path: configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml hash: md5 - md5: e8f88d45940e06207daf1eccb5fb5d8d - size: 351 + md5: a35f354b805d105999797d19d0aa7bde + size: 352 - path: configs/predict.yaml hash: md5 md5: 5fc8b9ac571d4a2209d7d866697252ab @@ -1279,8 +1279,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_997.json hash: md5 - md5: f143807267139bc29888fffb37474f08 - size: 1733286 + md5: 41a47dc56efc29b6c2771db68bdacb17 + size: 1822491 predict@Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned-7312: cmd: PYTHONPATH=. python scripts/sft/predict.py model=Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned random_seed=7312 @@ -1288,8 +1288,8 @@ stages: deps: - path: configs/model/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned.yaml hash: md5 - md5: e8f88d45940e06207daf1eccb5fb5d8d - size: 351 + md5: a35f354b805d105999797d19d0aa7bde + size: 352 - path: configs/predict.yaml hash: md5 md5: 5fc8b9ac571d4a2209d7d866697252ab @@ -1302,8 +1302,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_7312.json hash: md5 - md5: 4cf7e1890a19d7dd0ccc274862afc2b7 - size: 1718147 + md5: 302e1dc4f064007e3df88ac1e8acccc5 + size: 1831330 evaluate@Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned-42: cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_42.json @@ -1311,8 +1311,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_42.json hash: md5 - md5: 76924fe96291bafebb4259eb39a14ba3 - size: 1730656 + md5: 14d4613f7d9495f5fb5f2d7b81f402a9 + size: 1825646 - path: scripts/sft/evaluate.py hash: md5 md5: 73aa4a7eb8a035c087702457b9401654 @@ -1321,8 +1321,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/metrics_42.json hash: md5 - md5: c94893c5e006005134975da5b785c755 - size: 307 + md5: e43e3fe605787204ba1345dedaefd124 + size: 305 evaluate@Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned-7312: cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_7312.json @@ -1330,8 +1330,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_7312.json hash: md5 - md5: 4cf7e1890a19d7dd0ccc274862afc2b7 - size: 1718147 + md5: 302e1dc4f064007e3df88ac1e8acccc5 + size: 1831330 - path: scripts/sft/evaluate.py hash: md5 md5: 73aa4a7eb8a035c087702457b9401654 @@ -1340,8 +1340,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/metrics_7312.json hash: md5 - md5: 27e4f80abe3158b3301eb6260bf56105 - size: 306 + md5: b5d0fa11fe5557bbe1ee9804d5d09cb1 + size: 303 evaluate@Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned-997: cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_997.json @@ -1349,8 +1349,8 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/outputs_997.json hash: md5 - md5: f143807267139bc29888fffb37474f08 - size: 1733286 + md5: 41a47dc56efc29b6c2771db68bdacb17 + size: 1822491 - path: scripts/sft/evaluate.py hash: md5 md5: 73aa4a7eb8a035c087702457b9401654 @@ -1359,7 +1359,7 @@ stages: - path: data/experiments/predict/pl-court-instruct/Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned/metrics_997.json hash: md5 - md5: b1819e166db8ff9d65424decbdba5330 + md5: 403fc36606ced0ab31d34d3d548f948e size: 303 evaluate_llm_as_judge@llama_3.1_8b_instruct-Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned-997: cmd: PYTHONPATH=. python scripts/sft/evaluate_llm_as_judge.py api_model=llama_3.1_8b_instruct @@ -1499,9 +1499,9 @@ stages: outs: - path: data/experiments/fine-tune/Unsloth-Mistral-Nemo-Instruct-2407/pl-court-instruct hash: md5 - md5: c22563b3d92103e25b9658aff44a865c.dir - size: 352212245 - nfiles: 11 + md5: 80bceb56982e9bdb8d4b441bf843014f.dir + size: 1056899473 + nfiles: 33 predict@Bielik-7B-Instruct-v0.1-997: cmd: PYTHONPATH=. python scripts/sft/predict.py model=Bielik-7B-Instruct-v0.1 random_seed=997 @@ -1532,17 +1532,17 @@ stages: deps: - path: configs/predict_with_api.yaml hash: md5 - md5: 5233a5ec17722a946ee39468f19cd285 - size: 282 + md5: aff18078742a14c3d8ce2cd74e718d44 + size: 320 - path: scripts/sft/predict_with_api.py hash: md5 - md5: f4f3ce8f760f4c40aef228c466488f06 - size: 3945 + md5: 610d32b0036ae6eef4480c5a30f07999 + size: 3987 outs: - path: data/experiments/predict/pl-court-instruct/open_ai_gpt-4o/outputs_997.json hash: md5 - md5: efa592a94c9285c0100dfab05bb81de0 - size: 8612 + md5: 7c5833fdd1419163b286baaa3d71e084 + size: 1965252 predict_with_api@gpt-4o-mini-997: cmd: PYTHONPATH=. python scripts/sft/predict_with_api.py model_version=gpt-4o-mini seed=997 @@ -1550,12 +1550,12 @@ stages: deps: - path: configs/predict_with_api.yaml hash: md5 - md5: 5233a5ec17722a946ee39468f19cd285 - size: 282 + md5: aff18078742a14c3d8ce2cd74e718d44 + size: 320 - path: scripts/sft/predict_with_api.py hash: md5 - md5: d15e89fcbf106aae298e20959f396208 - size: 4033 + md5: 610d32b0036ae6eef4480c5a30f07999 + size: 3987 outs: - path: data/experiments/predict/pl-court-instruct/open_ai_gpt-4o-mini/outputs_997.json hash: md5 @@ -1639,3 +1639,207 @@ stages: hash: md5 md5: 65c808d4aebd8efe37b94a5128a19de6 size: 306 + sft_unsloth@Bielik-7B-Instruct-v0.1: + cmd: PYTHONPATH=. python scripts/sft/fine_tune_llm.py model=Bielik-7B-Instruct-v0.1 + deps: + - path: configs/fine_tuning.yaml + hash: md5 + md5: 3933c4faf5a478d0f9d3963c3b29e5cc + size: 1356 + - path: configs/model/Bielik-7B-Instruct-v0.1.yaml + hash: md5 + md5: c3412525e9819b53fbad06363a07a871 + size: 173 + - path: scripts/sft/fine_tune_llm.py + hash: md5 + md5: 4b77ee1ea604cae18f17ca00cdb6988b + size: 4578 + outs: + - path: data/experiments/fine-tune/Bielik-7B-Instruct-v0.1/pl-court-instruct + hash: md5 + md5: be61ab5ea1365c1bcf908952bc015ab4.dir + size: 2293711014 + nfiles: 108 + predict@Bielik-7B-Instruct-v0.1-fine-tuned-42: + cmd: PYTHONPATH=. python scripts/sft/predict.py model=Bielik-7B-Instruct-v0.1-fine-tuned + random_seed=42 + output_file=data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_42.json + deps: + - path: configs/model/Bielik-7B-Instruct-v0.1-fine-tuned.yaml + hash: md5 + md5: 2d9590869dfe247d7c6335f3cd7dd0c2 + size: 253 + - path: configs/predict.yaml + hash: md5 + md5: 5fc8b9ac571d4a2209d7d866697252ab + size: 402 + - path: scripts/sft/predict.py + hash: md5 + md5: f9acd63cd4d682ae2242d7b51f0d974b + size: 3198 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_42.json + hash: md5 + md5: 178eb0649617d4a698da6c9e315e84c5 + size: 2034749 + predict@Bielik-7B-Instruct-v0.1-fine-tuned-7312: + cmd: PYTHONPATH=. python scripts/sft/predict.py model=Bielik-7B-Instruct-v0.1-fine-tuned + random_seed=7312 + output_file=data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_7312.json + deps: + - path: configs/model/Bielik-7B-Instruct-v0.1-fine-tuned.yaml + hash: md5 + md5: 2d9590869dfe247d7c6335f3cd7dd0c2 + size: 253 + - path: configs/predict.yaml + hash: md5 + md5: 5fc8b9ac571d4a2209d7d866697252ab + size: 402 + - path: scripts/sft/predict.py + hash: md5 + md5: f9acd63cd4d682ae2242d7b51f0d974b + size: 3198 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_7312.json + hash: md5 + md5: 743ea22448bc73a7a991da075fca8841 + size: 2031343 + predict@Bielik-7B-Instruct-v0.1-fine-tuned-997: + cmd: PYTHONPATH=. python scripts/sft/predict.py model=Bielik-7B-Instruct-v0.1-fine-tuned + random_seed=997 + output_file=data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_997.json + deps: + - path: configs/model/Bielik-7B-Instruct-v0.1-fine-tuned.yaml + hash: md5 + md5: 2d9590869dfe247d7c6335f3cd7dd0c2 + size: 253 + - path: configs/predict.yaml + hash: md5 + md5: 5fc8b9ac571d4a2209d7d866697252ab + size: 402 + - path: scripts/sft/predict.py + hash: md5 + md5: f9acd63cd4d682ae2242d7b51f0d974b + size: 3198 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_997.json + hash: md5 + md5: 433a4b2aa7870a134277a265d099a588 + size: 2029482 + evaluate@Bielik-7B-Instruct-v0.1-42: + cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/outputs_42.json + deps: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/outputs_42.json + hash: md5 + md5: 2dc39513a04910c5d0c54380166639d9 + size: 2029644 + - path: scripts/sft/evaluate.py + hash: md5 + md5: 73aa4a7eb8a035c087702457b9401654 + size: 636 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/metrics_42.json + hash: md5 + md5: 2cbca38fd0bbdb4df024f76506eeb26c + size: 307 + evaluate@Bielik-7B-Instruct-v0.1-7312: + cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/outputs_7312.json + deps: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/outputs_7312.json + hash: md5 + md5: ae39bf31296ffe82c0f6a3e8c9ff63aa + size: 2014399 + - path: scripts/sft/evaluate.py + hash: md5 + md5: 73aa4a7eb8a035c087702457b9401654 + size: 636 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/metrics_7312.json + hash: md5 + md5: ad13d47ca88e721be75c79c225e12ee6 + size: 289 + evaluate@Bielik-7B-Instruct-v0.1-997: + cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/outputs_997.json + deps: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/outputs_997.json + hash: md5 + md5: fac04d78ad020b50f79fc7277a037e8e + size: 2016400 + - path: scripts/sft/evaluate.py + hash: md5 + md5: 73aa4a7eb8a035c087702457b9401654 + size: 636 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1/metrics_997.json + hash: md5 + md5: 83fb160145ef5e21b43f7c348658ea02 + size: 327 + evaluate@Bielik-7B-Instruct-v0.1-fine-tuned-42: + cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_42.json + deps: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_42.json + hash: md5 + md5: 178eb0649617d4a698da6c9e315e84c5 + size: 2034749 + - path: scripts/sft/evaluate.py + hash: md5 + md5: 73aa4a7eb8a035c087702457b9401654 + size: 636 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/metrics_42.json + hash: md5 + md5: 99e684c720ca4c4ef6c4276e7d1880ab + size: 305 + evaluate@Bielik-7B-Instruct-v0.1-fine-tuned-7312: + cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_7312.json + deps: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_7312.json + hash: md5 + md5: 743ea22448bc73a7a991da075fca8841 + size: 2031343 + - path: scripts/sft/evaluate.py + hash: md5 + md5: 73aa4a7eb8a035c087702457b9401654 + size: 636 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/metrics_7312.json + hash: md5 + md5: 07d798079cedf3dc194242d6a1bc3bcd + size: 306 + evaluate@Bielik-7B-Instruct-v0.1-fine-tuned-997: + cmd: PYTHONPATH=. python scripts/sft/evaluate.py --output-file + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_997.json + deps: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/outputs_997.json + hash: md5 + md5: 433a4b2aa7870a134277a265d099a588 + size: 2029482 + - path: scripts/sft/evaluate.py + hash: md5 + md5: 73aa4a7eb8a035c087702457b9401654 + size: 636 + outs: + - path: + data/experiments/predict/pl-court-instruct/Bielik-7B-Instruct-v0.1-fine-tuned/metrics_997.json + hash: md5 + md5: adb7c1e239396bbf6e308f3f1b436099 + size: 307 diff --git a/dvc.yaml b/dvc.yaml index ada8583..b4acbb7 100644 --- a/dvc.yaml +++ b/dvc.yaml @@ -1,5 +1,5 @@ vars: - - seeds: [42, 7312, 997] + - seeds: [ 42, 7312, 997 ] stages: raw_dataset_readme: @@ -89,6 +89,7 @@ stages: - Unsloth-Llama-3-8B-Instruct - Unsloth-Mistral-7B-Instruct-v0.3 - Unsloth-Mistral-Nemo-Instruct-2407 + - Bielik-7B-Instruct-v0.1 cmd: >- PYTHONPATH=. python scripts/sft/fine_tune_llm.py model=${item.model} deps: @@ -107,6 +108,8 @@ stages: - Unsloth-Mistral-7B-Instruct-v0.3-fine-tuned - Unsloth-Mistral-Nemo-Instruct-2407 - Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned + - Bielik-7B-Instruct-v0.1 + - Bielik-7B-Instruct-v0.1-fine-tuned seed: ${seeds} cmd: >- PYTHONPATH=. python scripts/sft/predict.py @@ -147,6 +150,8 @@ stages: - Unsloth-Mistral-7B-Instruct-v0.3-fine-tuned - Unsloth-Mistral-Nemo-Instruct-2407 - Unsloth-Mistral-Nemo-Instruct-2407-fine-tuned + - Bielik-7B-Instruct-v0.1 + - Bielik-7B-Instruct-v0.1-fine-tuned - open_ai_gpt-4o - open_ai_gpt-4o-mini seed: ${seeds} diff --git a/juddges/models/factory.py b/juddges/models/factory.py index 920fae7..4c39517 100644 --- a/juddges/models/factory.py +++ b/juddges/models/factory.py @@ -18,7 +18,7 @@ class ModelForGeneration: def get_model(llm_config: LLMConfig, **kwargs: Any) -> ModelForGeneration: if "llama" in llm_config.name.lower(): return get_llama_3(llm_config, **kwargs) - elif "mistral" in llm_config.name.lower(): + elif any(mistral_model in llm_config.name.lower() for mistral_model in ("mistral", "bielik")): return get_mistral(llm_config, **kwargs) else: raise ValueError(f"Model: {llm_config} not yet handled or doesn't exists.")