Reyad-Ahmmed commited on
Commit
46c461b
·
verified ·
1 Parent(s): 84e3821

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -77,11 +77,22 @@ if (should_train_model=='1'): #train model
77
 
78
  # Read the CSV files into pandas DataFrames they will later by converted to DataTables and used to train and evaluate the model
79
 
 
 
 
 
 
 
 
 
 
 
 
80
  #file_train_df = fetch_and_update_training_data(file_path_train)
81
  #file_test_df = pd.read_csv(file_path_test)
82
 
83
- file_train_df = pd.read_csv(file_path_train)
84
- file_test_df = pd.read_csv(file_path_test)
85
 
86
  #combine dataframes to get all possible labels/classifications for both training and evaluating - to get all possible labels (intents)
87
  df = pd.concat([file_train_df, file_test_df], ignore_index=True)
 
77
 
78
  # Read the CSV files into pandas DataFrames they will later by converted to DataTables and used to train and evaluate the model
79
 
80
+
81
+ # Check if the result is a non-empty DataFrame
82
+ file_train_df = fetch_and_update_training_data(file_path_train)
83
+
84
+ if file_train_df is not None and not file_train_df.empty:
85
+ file_train_df = fetch_and_update_training_data(file_path_train)
86
+ file_test_df = pd.read_csv(file_path_test)
87
+ else:
88
+ file_train_df = pd.read_csv(file_path_train)
89
+ file_test_df = pd.read_csv(file_path_test)
90
+
91
  #file_train_df = fetch_and_update_training_data(file_path_train)
92
  #file_test_df = pd.read_csv(file_path_test)
93
 
94
+ #file_train_df = pd.read_csv(file_path_train)
95
+ #file_test_df = pd.read_csv(file_path_test)
96
 
97
  #combine dataframes to get all possible labels/classifications for both training and evaluating - to get all possible labels (intents)
98
  df = pd.concat([file_train_df, file_test_df], ignore_index=True)