Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,9 +37,16 @@ class ChatDataset(Dataset):
|
|
| 37 |
|
| 38 |
# Load training data from Hugging Face
|
| 39 |
def load_training_data():
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
# Fine-tune model with differential privacy
|
| 45 |
def train_model():
|
|
|
|
| 37 |
|
| 38 |
# Load training data from Hugging Face
|
| 39 |
def load_training_data():
|
| 40 |
+
try:
|
| 41 |
+
with open("training_data.txt", "r", encoding="utf-8") as file:
|
| 42 |
+
texts = [line.strip() for line in file if line.strip()]
|
| 43 |
+
return texts
|
| 44 |
+
except FileNotFoundError:
|
| 45 |
+
print("Error: training_data.txt not found in the root directory.")
|
| 46 |
+
return []
|
| 47 |
+
except Exception as e:
|
| 48 |
+
print(f"Error reading training_data.txt: {e}")
|
| 49 |
+
return []
|
| 50 |
|
| 51 |
# Fine-tune model with differential privacy
|
| 52 |
def train_model():
|