Created
February 1, 2026 15:48
-
-
Save me-suzy/beff39cefe60ae33f05f0ebf1f07548a to your computer and use it in GitHub Desktop.
conversie.py
This file contains hidden or 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
| import json | |
| import os | |
| # Folderul unde ai cele 100 de fișiere txt | |
| input_folder = 'calea/catre/fisiere' | |
| output_file = 'date_antrenament_isambard.jsonl' | |
| with open(output_file, 'w', encoding='utf-8') as f_out: | |
| for filename in os.listdir(input_folder): | |
| if filename.endswith(".txt"): | |
| with open(os.path.join(input_folder, filename), 'r', encoding='utf-8') as f_in: | |
| continut = f_in.read() | |
| # Structura pentru antrenament (Prompt + Stilul tău de gândire) | |
| data_point = { | |
| "instruction": f"Gândește conform metodei din fișierul {filename}", | |
| "input": "", | |
| "output": continut | |
| } | |
| f_out.write(json.dumps(data_point, ensure_ascii=False) + '\n') | |
| print(f"Conversie finalizată! Fișierul {output_file} este gata pentru Isambard.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment