Trying to expand horizins

This commit is contained in:
2026-07-01 21:47:45 -06:00
parent 10591c24ef
commit e397f5a264
16 changed files with 439779 additions and 11 deletions
+3 -11
View File
@@ -28,8 +28,7 @@ EMBEDDING_DIM = 256
RNN_UNITS = 512
# Pipeline & Training Hyperparameters
TEXT_FILE = "saved_files/pg14314.txt"
FILE_URL = 'https://www.gutenberg.org/cache/epub/14314/pg14314.txt'
TEXT_FILE = "combined_training_data.txt"
VOCAB_FILE = "vocab.txt"
# DYNAMICALLY MANGLED DIRECTORY:
@@ -78,15 +77,8 @@ if os.path.exists(VOCAB_FILE):
vocab = json.load(f)
else:
if not os.path.exists(TEXT_FILE):
print(f"File '{TEXT_FILE}' not found locally. Downloading it.")
# Download the file\mn",
downloaded_path = tf.keras.utils.get_file('tmp', FILE_URL)
# Save the downloaded file to the designated local directory
with open(downloaded_path, 'rb') as source_file:
with open(local_path, 'wb') as dest_file:
dest_file.write(source_file.read())
print(f"File '{TEXT_FILE}' not found locally. Please run the process.py script!")
quit(1)
print(f"Loading raw text from {TEXT_FILE} to build vocabulary...")
with open(TEXT_FILE, 'r', encoding='utf-8') as f: