diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd51045c..29480fcc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,31 +1,12 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [main] pull_request: branches: [main] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action - with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} # Located in GitHub secrets - heroku_app_name: "web-eye-tracker-1204" # Must be unique in Heroku - heroku_email: "karine.pistili@gmail.com" diff --git a/app/routes/session.py b/app/routes/session.py index 1db18593..fd6d0ea7 100644 --- a/app/routes/session.py +++ b/app/routes/session.py @@ -6,7 +6,7 @@ import csv import math import numpy as np - +import uuid from pathlib import Path import os import pandas as pd @@ -24,6 +24,7 @@ # Constants + ALLOWED_EXTENSIONS = {"txt", "webm"} COLLECTION_NAME = "session" @@ -162,7 +163,7 @@ def batch_predict(): base_path = Path().absolute() / "app/services/calib_validation/csv/data" calib_csv_path = base_path / f"{calib_id}_fixed_train_data.csv" - predict_csv_path = base_path / "temp_batch_predict.csv" + predict_csv_path = base_path / f"temp_batch_predict_{uuid.uuid4().hex}.csv" # CSV temporário with open(predict_csv_path, "w", newline="") as csvfile: @@ -187,7 +188,8 @@ def batch_predict(): screen_width=screen_width, screen_height=screen_height, ) - + os.remove(predict_csv_path) + return jsonify(convert_nan_to_none(result)) except Exception as e: