Skip to content

Commit

Permalink
added time based train
Browse files Browse the repository at this point in the history
  • Loading branch information
amjadnzr committed May 5, 2019
1 parent 0e62ec8 commit 5cc599a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Amjad/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,30 @@
import surprise
from dataset.AddRating import addRate
from dataset.AddRating import addManyRate
from apscheduler.schedulers.background import BackgroundScheduler
#from RBMBakeOff import TrainModel

app = Flask(__name__)
print(app)

# test api
@app.route("/")



def home():
return "Hello World"

def trainNow():
# print("Hello")
BakeOff.TrainModel()

sched = BackgroundScheduler(daemon=True)
sched.add_job(trainNow,'interval',seconds=600)
sched.start()
# minutes=60
# hours=1
# test api


# train the model
# TrainModel()

Expand Down Expand Up @@ -82,8 +96,10 @@ def addManyRating():

# Running the server in localhost:5000
if __name__ == '__main__':
app.run(debug=True)
app.run(debug=True)






Expand Down

0 comments on commit 5cc599a

Please sign in to comment.