diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..c53e6e7 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,20 @@ +name: Docker deployment check + +on: + pull_request: + push: + workflow_dispatch: + schedule: + - cron: "5 8 * * 0" + +jobs: + docker: + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Start containers + run: docker-compose -f "docker-compose.yml" up -d --build \ No newline at end of file diff --git a/similarity.py b/similarity.py index 414cc61..a4bb913 100644 --- a/similarity.py +++ b/similarity.py @@ -54,8 +54,8 @@ def check_similarity_from_parquet(input_sentence): def check_similarity(input_string, check_type = 1): if check_type == 1: # Initialize the MongoDB client - client = MongoClient(os.getenv('MONGODB_URI')) # Replace with your MongoDB connection string - db = client["mydb"] + mongo_client = MongoClient(os.getenv('MONGODB_URI')) # Replace with your MongoDB connection string + db = mongo_client["mydb"] prompts_collection = db["good_prompts"] prompt_list = [x['last_prompt'] for x in prompts_collection.find({})] return check_similarity_from_list(input_string, prompt_list)