BelikanM commited on
Commit
c566e03
·
verified ·
1 Parent(s): 8c3befa

Upload KIBALI Expert 4: Multi-Format ERT analysis

Browse files
README.md ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: BelikanM/kibali-instruct-7b-lora
4
+ tags:
5
+ - ert
6
+ - geophysics
7
+ - electrical-resistivity-tomography
8
+ - dat-files
9
+ - multi-format
10
+ - peft
11
+ - lora
12
+ - kibali-ecosystem
13
+ language:
14
+ - fr
15
+ - en
16
+ library_name: peft
17
+ ---
18
+
19
+ # KIBALI Expert 4: Analyse Multi-Format de fichiers ERT .dat
20
+
21
+ ## 🎯 Description
22
+
23
+ **Expert spécialisé dans l'analyse et l'interprétation de fichiers ERT .dat avec DEUX structures différentes.**
24
+
25
+ Construit **SUR KIBALI Phase 1** (base scientifique) pour créer un écosystème hiérarchique.
26
+
27
+ ### 📊 Format 1: Fréquence/Résistivité
28
+ - Structure compacte avec fréquences en MHz
29
+ - Mesures de résistivité apparente par profil
30
+ - Format: `PROFIL NAME,station,val1,val2,...`
31
+ - Usage: Acquisitions multi-fréquences
32
+
33
+ ### 📋 Format 2: Tabulaire XYZ
34
+ - Colonnes avec en-tête explicite
35
+ - Format: `survey-point depth data project`
36
+ - Géoréférencé pour cartographie
37
+ - Compatible logiciels GIS
38
+
39
+ ## 🔬 Capacités
40
+
41
+ - **Détection automatique** du format de fichier
42
+ - **Analyse structurelle** des deux formats
43
+ - **Extraction de statistiques** (min, max, moyenne, écart-type)
44
+ - **Interprétation géophysique** des valeurs
45
+ - **Recommandations** sur l'usage approprié de chaque format
46
+ - **Conversion** conceptuelle entre formats
47
+
48
+ ## 📊 Entraînement
49
+
50
+ - **Modèle de base**: KIBALI Phase 1 (BelikanM/kibali-instruct-7b-lora)
51
+ - **Méthode**: LoRA additionnel léger (r=2)
52
+ - **Paramètres entraînables**: 35,979,264 (0.4944%)
53
+ - **Dataset**: 9 exemples basés sur des fichiers ERT réels
54
+ - **Formats**: PROFIL AMAEL.dat (fréquence) + PROFIL AMAEL_xyz.dat (xyz)
55
+
56
+ ## 💻 Utilisation
57
+
58
+ ```python
59
+ from transformers import AutoModelForCausalLM, AutoTokenizer
60
+ from peft import PeftModel
61
+
62
+ # Chargement hiérarchique: Mistral → KIBALI Phase 1 → Expert 4
63
+ base_model = AutoModelForCausalLM.from_pretrained(
64
+ "mistralai/Mistral-7B-Instruct-v0.2",
65
+ device_map="auto",
66
+ torch_dtype=torch.float16
67
+ )
68
+
69
+ # Appliquer KIBALI Phase 1
70
+ kibali_base = PeftModel.from_pretrained(base_model, "BelikanM/kibali-instruct-7b-lora")
71
+
72
+ # Appliquer Expert 4
73
+ model = PeftModel.from_pretrained(kibali_base, "BelikanM/kibali-expert4-multi-format")
74
+ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
75
+
76
+ # Inférence
77
+ prompt = "[INST] Explique les différences entre les formats ERT .dat [/INST]"
78
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
79
+ outputs = model.generate(**inputs, max_length=512)
80
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
81
+ ```
82
+
83
+ ## 🌟 Écosystème KIBALI
84
+
85
+ Cet expert fait partie de l'écosystème KIBALI hiérarchique:
86
+
87
+ ```
88
+ Mistral-7B (13GB)
89
+
90
+ KIBALI Phase 1 (base scientifique) +161MB
91
+
92
+ └──> Expert 4: Multi-format .dat +15MB ← ICI
93
+ ```
94
+
95
+ **Avantage**: Architecture hiérarchique efficace !
96
+
97
+ ## 📄 Licence
98
+
99
+ Apache 2.0 - Identique au modèle de base Mistral
100
+
101
+ ## 👨‍🔬 Auteur
102
+
103
+ BelikanM - Écosystème KIBALI pour la géophysique appliquée
adapter_config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": null,
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 4,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": null,
25
+ "peft_type": "LORA",
26
+ "peft_version": "0.18.0",
27
+ "qalora_group_size": 16,
28
+ "r": 2,
29
+ "rank_pattern": {},
30
+ "revision": null,
31
+ "target_modules": [
32
+ "k_proj",
33
+ "q_proj"
34
+ ],
35
+ "target_parameters": null,
36
+ "task_type": "CAUSAL_LM",
37
+ "trainable_token_indices": null,
38
+ "use_dora": false,
39
+ "use_qalora": false,
40
+ "use_rslora": false
41
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae4ef8c196cb03c60a2d4ae37b8505461b9ebad3d1bd3de94a5a4d57599bdd07
3
+ size 143984528
chat_template.jinja ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if messages[0]['role'] == 'system' %}
2
+ {%- set system_message = messages[0]['content'] %}
3
+ {%- set loop_messages = messages[1:] %}
4
+ {%- else %}
5
+ {%- set loop_messages = messages %}
6
+ {%- endif %}
7
+
8
+ {{- bos_token }}
9
+ {%- for message in loop_messages %}
10
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}
11
+ {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}
12
+ {%- endif %}
13
+ {%- if message['role'] == 'user' %}
14
+ {%- if loop.first and system_message is defined %}
15
+ {{- ' [INST] ' + system_message + '\n\n' + message['content'] + ' [/INST]' }}
16
+ {%- else %}
17
+ {{- ' [INST] ' + message['content'] + ' [/INST]' }}
18
+ {%- endif %}
19
+ {%- elif message['role'] == 'assistant' %}
20
+ {{- ' ' + message['content'] + eos_token}}
21
+ {%- else %}
22
+ {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }}
23
+ {%- endif %}
24
+ {%- endfor %}
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "</s>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "additional_special_tokens": [],
32
+ "bos_token": "<s>",
33
+ "clean_up_tokenization_spaces": false,
34
+ "eos_token": "</s>",
35
+ "extra_special_tokens": {},
36
+ "legacy": false,
37
+ "model_max_length": 1000000000000000019884624838656,
38
+ "pad_token": "</s>",
39
+ "sp_model_kwargs": {},
40
+ "spaces_between_special_tokens": false,
41
+ "tokenizer_class": "LlamaTokenizer",
42
+ "unk_token": "<unk>",
43
+ "use_default_system_prompt": false
44
+ }