Skip to content

Commit

Permalink
Data loading portion of train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lim185 committed Dec 8, 2024
1 parent 26c35cc commit 0ea663b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
train.py
Launches the training process for the model.
"""

from pathlib import Path

from pipe.pipe import SpectrogramPipe
from pyspark.sql import SparkSession

def main():
path = Path("/app/datadump/train")

labels = []
with open(path / "train.csv", "r") as file:
for line in file:
labels.append(line.strip().split(","))

spark = SparkSession.builder.appName("train").getOrCreate()
pipe = SpectrogramPipe(spark)
data = pipe.spectrogram_pipe(path, labels)
print(data.head())

return

if __name__ == "__main__":
main()

# EOF

0 comments on commit 0ea663b

Please sign in to comment.