Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Recommendation Engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
URBANITE
Open
Recommendation Engine
Commits
0b4200f4
Commit
0b4200f4
authored
2 years ago
by
Campos Cordobes, Sergio
Browse files
Options
Downloads
Patches
Plain Diff
Update app.py
parent
f7290514
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app.py
+28
-2
28 additions, 2 deletions
app.py
with
28 additions
and
2 deletions
app.py
+
28
−
2
View file @
0b4200f4
...
...
@@ -11,7 +11,8 @@ import pysmile
import
sys
import
json
print
(
sys
.
path
)
from
src
import
constants
from
src
import
constants
,
pysmile_license
import
mysql.connector
from
flask
import
Flask
,
request
,
render_template
...
...
@@ -19,6 +20,16 @@ from flask import Flask, request, render_template
from
src
import
configuration
,
recommender
,
database
,
planner
,
modal_choice
app
=
Flask
(
__name__
)
model
=
pickle
.
load
(
open
(
'
model.pkcls
'
,
'
rb
'
))
"""
net = pysmile.Network()
"""
#CORS
from
flask_cors
import
CORS
cors
=
CORS
(
app
,
resources
=
{
r
"
/*
"
:
{
"
origins
"
:
"
*
"
}})
cnx
=
None
...
...
@@ -29,6 +40,17 @@ def index():
# MODAL CHOICE: -------------------------------------------------------------------------------------------------------
@app.get
(
"
/modal_choice/getConfigurationFile
"
)
def
modal_choice_getconfigurationfile
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
modal_choice
.
modal_choice_getconfigurationfile
(
cnx
,
request
)
@app.get
(
"
/modal_choice/estimation
"
)
def
modal_choice_estimation
():
"""
...
...
@@ -265,6 +287,10 @@ def database_store_kpi_relative_area():
# MAIN: ----------------------------------------------------------------------------------------------------------------
if
__name__
==
"
__main__
"
:
model
=
pickle
.
load
(
open
(
'
model.pkcls
'
,
'
rb
'
))
"""
model = pickle.load(open(
'
model.pkcls
'
,
'
rb
'
))
net = pysmile.Network()
net.read_file(
"
URBANITE_ModalChoice.xdsl
"
);
"""
cnx
=
mysql
.
connector
.
connect
(
**
constants
.
DDBB_CONFIG
)
app
.
run
(
debug
=
True
,
host
=
'
0.0.0.0
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment