Skip to content

Commit

Permalink
Merge pull request #5 from M507/dev
Browse files Browse the repository at this point in the history
Docker check action
  • Loading branch information
M507 authored Dec 22, 2023
2 parents 92b90fd + 273dbda commit 0d58d82
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d58d82

Please sign in to comment.