Skip to content

Commit

Permalink
improve docker setup, add 1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Oct 10, 2024
1 parent d091e22 commit 7a9d6aa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
api:
build: .
container_name: api
restart: unless-stopped
depends_on:
- vectordb
ports:
Expand Down
7 changes: 7 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
if [ "$1" = "--build" ]; then
echo "📦️ Re-building"
ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; git pull ; podman-compose up --force-recreate --build -d"'

elif [ "$1" = "--clean" ]; then
echo "🧹 Cleaning up the vector database"
ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; git pull ; rm -rf data/qdrant ; podman-compose up --force-recreate -d"'

elif [ "$1" = "--logs" ]; then
ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; podman-compose logs api"'

elif [ "$1" = "--likes" ]; then
mkdir -p data/prod
scp expasychat:/var/containers/podman/sparql-llm/data/logs/likes.jsonl ./data/prod/
scp expasychat:/var/containers/podman/sparql-llm/data/logs/dislikes.jsonl ./data/prod/
scp expasychat:/var/containers/podman/sparql-llm/data/logs/user_questions.log ./data/prod/

else
ssh expasychat 'sudo -u podman bash -c "cd /var/containers/podman/sparql-llm ; git pull ; podman-compose up --force-recreate -d"'
fi
16 changes: 16 additions & 0 deletions notebooks/test_expasy_chat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,22 @@
"}\n",
"\"\"\",\n",
" },\n",
" {\n",
" \"question\": \"What is the function of APOC1? Return ?function\",\n",
" \"endpoint\": \"https://sparql.uniprot.org/sparql/\",\n",
" \"query\": \"\"\"PREFIX up: <http://purl.uniprot.org/core/>\n",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n",
"PREFIX dcterms: <http://purl.org/dc/terms/>\n",
"SELECT DISTINCT ?function WHERE {\n",
" ?protein a up:Protein ;\n",
" up:mnemonic \"APOC1_HUMAN\" ;\n",
" up:annotation ?annotation .\n",
" ?annotation a up:Function_Annotation ;\n",
" rdfs:comment ?function .\n",
"}\n",
"\"\"\",\n",
" },\n",
"\n",
"\n",
" # New queries to test:\n",
" # Find all proteins linked to arachidonate (CHEBI:32395) and their associated pathways\n",
Expand Down

0 comments on commit 7a9d6aa

Please sign in to comment.