Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -35,10 +35,13 @@ def generate_response(input_text):
|
|
35 |
# Fonction pour créer un nouveau répertoire d'entraînement et sauvegarder le modèle
|
36 |
def create_training_folder_and_save_model(dataset_path, dataset_file, epochs, batch_size):
|
37 |
# Récupération du chemin du répertoire de base
|
38 |
-
base_path = os.path.join(model_name, "FT")
|
|
|
39 |
|
|
|
40 |
# Récupération des dossiers existants et incrémentation du numéro
|
41 |
-
existing_folders = [folder for folder in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, folder))]
|
|
|
42 |
new_folder_num = len(existing_folders) + 1
|
43 |
new_folder_name = f"TRAIN{new_folder_num:02d}"
|
44 |
|
@@ -50,11 +53,11 @@ def create_training_folder_and_save_model(dataset_path, dataset_file, epochs, ba
|
|
50 |
print("Création du nouveau répertoire d'entraînement en cours...")
|
51 |
print(f"Nouveau répertoire créé : {new_folder_path}")
|
52 |
|
53 |
-
# Chargement du dataset
|
54 |
-
if dataset_path.startswith("https://huggingface.co/datasets/"):
|
55 |
-
dataset = load_dataset('json', data_files={dataset_file: dataset_path})
|
56 |
-
else:
|
57 |
-
dataset = load_dataset('json', data_files={dataset_file: dataset_path})
|
58 |
|
59 |
|
60 |
|
@@ -152,3 +155,4 @@ if __name__ == "__main__":
|
|
152 |
demo.launch()
|
153 |
|
154 |
# Je n'ai pas trouvé de documentation officielle sur la création de répertoires dans l'espace de travail Hugging Face.
|
|
|
|
35 |
# Fonction pour créer un nouveau répertoire d'entraînement et sauvegarder le modèle
|
36 |
def create_training_folder_and_save_model(dataset_path, dataset_file, epochs, batch_size):
|
37 |
# Récupération du chemin du répertoire de base
|
38 |
+
# base_path = os.path.join(model_name, "FT")
|
39 |
+
base_path = os.path.join(model_name, "resolve", "main", "FT")
|
40 |
|
41 |
+
|
42 |
# Récupération des dossiers existants et incrémentation du numéro
|
43 |
+
# existing_folders = [folder for folder in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, folder))]
|
44 |
+
existing_folders = [folder for folder in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, folder))]
|
45 |
new_folder_num = len(existing_folders) + 1
|
46 |
new_folder_name = f"TRAIN{new_folder_num:02d}"
|
47 |
|
|
|
53 |
print("Création du nouveau répertoire d'entraînement en cours...")
|
54 |
print(f"Nouveau répertoire créé : {new_folder_path}")
|
55 |
|
56 |
+
# # Chargement du dataset
|
57 |
+
# if dataset_path.startswith("https://huggingface.co/datasets/"):
|
58 |
+
# dataset = load_dataset('json', data_files={dataset_file: dataset_path})
|
59 |
+
# else:
|
60 |
+
# dataset = load_dataset('json', data_files={dataset_file: dataset_path})
|
61 |
|
62 |
|
63 |
|
|
|
155 |
demo.launch()
|
156 |
|
157 |
# Je n'ai pas trouvé de documentation officielle sur la création de répertoires dans l'espace de travail Hugging Face.
|
158 |
+
|