Trying to expand horizins
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user