Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
text-to-role-classification
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Setting up 2FA is now mandatory for all users.
Show more breadcrumbs
ehai
text-to-role-classification
Commits
e3de37f1
Commit
e3de37f1
authored
2 years ago
by
Katrien Beuls
Browse files
Options
Downloads
Patches
Plain Diff
changed port to 3600
parent
b131785f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example_request.py
+3
-3
3 additions, 3 deletions
example_request.py
server.py
+2
-2
2 additions, 2 deletions
server.py
with
5 additions
and
5 deletions
example_request.py
+
3
−
3
View file @
e3de37f1
import
requests
import
requests
r
=
requests
.
post
(
'
http://localhost:
50
00/predict
'
,
r
=
requests
.
post
(
'
http://localhost:
36
00/predict
'
,
json
=
[
"
Great
"
,
json
=
[
"
Great
"
,
"
temporarily
"
,
"
temporarily
"
,
"
following his visit to Japan this time
"
,
"
following his visit to Japan this time
"
,
"
for coming to the studio for our interview
"
,
"
for coming to the studio for our interview
"
,
"
briefly
"
])
"
briefly
"
])
...
...
This diff is collapsed.
Click to expand it.
server.py
+
2
−
2
View file @
e3de37f1
from
flask
import
Flask
,
jsonify
,
request
from
flask
import
Flask
,
jsonify
,
request
import
pickle
import
pickle
import
spacy_sentence_bert
import
spacy_sentence_bert
NLP
=
spacy_sentence_bert
.
load_model
(
'
en_stsb_distilbert_base
'
)
NLP
=
spacy_sentence_bert
.
load_model
(
'
en_stsb_distilbert_base
'
)
MODEL
=
pickle
.
load
(
open
(
'
model.pkl
'
,
'
rb
'
))
MODEL
=
pickle
.
load
(
open
(
'
model.pkl
'
,
'
rb
'
))
...
@@ -23,4 +23,4 @@ def predict():
...
@@ -23,4 +23,4 @@ def predict():
return
jsonify
(
predictions
)
return
jsonify
(
predictions
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
.
run
(
debug
=
True
,
port
=
50
00
)
app
.
run
(
debug
=
True
,
port
=
36
00
)
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