Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
moved dir creation from setup to build_donkeybot; relates #18
Browse files Browse the repository at this point in the history
  • Loading branch information
mageirakos committed Aug 20, 2020
1 parent e7dfb3e commit c60e039
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
46 changes: 31 additions & 15 deletions scripts/build_donkeybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
# 4) Creates rucio documentation and questions indexes for the SearchEngine
# 5) Saves all of the above under '/data/data_storage.db'

#bot modules
import bot.config as config

# general python
import subprocess
import argparse
import os


def main():
Expand All @@ -30,25 +35,36 @@ def main():
args = parser.parse_args()
api_token = args.token

# fetch and store data
subprocess.run(
f"python -m scripts.fetch_issues -r rucio/rucio -t {api_token}", shell=True,
)
subprocess.run(
f"python -m scripts.fetch_rucio_docs -t {api_token}", shell=True,
)
# parse and store data
subprocess.run(
f"python -m scripts.parse_all", shell=True,
)
# detect questions in data_storage
subprocess.run(
f"python -m scripts.detect_all_questions", shell=True,
)
# # fetch and store data
# subprocess.run(
# f"python -m scripts.fetch_issues -r rucio/rucio -t {api_token}", shell=True,
# )
# subprocess.run(
# f"python -m scripts.fetch_rucio_docs -t {api_token}", shell=True,
# )
# # parse and store data
# subprocess.run(
# f"python -m scripts.parse_all", shell=True,
# )
# # detect questions in data_storage
# subprocess.run(
# f"python -m scripts.detect_all_questions", shell=True,
# )
# create search engine for documents and questions
subprocess.run(
f"python -m scripts.create_se_indexes", shell=True,
)
# download BERT models for Question Answering
try:
os.makedirs(config.DATA_DIR+"models/distilbert-base-cased-distilled-squad")
os.makedirs(config.DATA_DIR+"models/bert-large-cased-whole-word-masking-finetuned-squad")
os.makedirs(config.DATA_DIR+"models/bert-large-uncased-whole-word-masking-finetuned-squad")
except FileExistsError as _e:
print(_e)
print('moving on...')

print('Done!')



if __name__ == "__main__":
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from setuptools import setup, find_packages
import os

try:
os.mkdir("data")
except FileExistsError as _e:
pass

with open("README.md", "r") as fh:
long_description = fh.read()
Expand Down

0 comments on commit c60e039

Please sign in to comment.