Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCore-Python
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
Show more breadcrumbs
VIPS
VIPSCore-Python
Commits
0bad9c36
Commit
0bad9c36
authored
2 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Update documentation
parent
d30ad6b0
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
README.md
+2
-0
2 additions, 0 deletions
README.md
app/main.py
+20
-4
20 additions, 4 deletions
app/main.py
with
22 additions
and
4 deletions
README.md
+
2
−
0
View file @
0bad9c36
...
...
@@ -62,6 +62,8 @@ pip install -r models.txt
(
venv
)
$
uvicorn app.main:app
--reload
```
The server application is available on
`http://localhost:8000`
. To see the endpoint documentation, go to
`http://localhost:8000/docs`
## Troubleshooting for Mac users
2023-02-14: When running the app locally on a Mac, this error occured when calling the /models endpoint:
...
...
This diff is collapsed.
Click to expand it.
app/main.py
+
20
−
4
View file @
0bad9c36
from
fastapi
import
FastAPI
,
Response
,
status
from
fastapi.responses
import
PlainTextResponse
from
fastapi.responses
import
PlainTextResponse
,
HTMLResponse
from
app.internal.model_factory
import
*
from
vipscore_common.vips_model
import
VIPSModel
from
vipscore_common.entities
import
ModelConfiguration
,
Result
...
...
@@ -24,9 +24,9 @@ app = FastAPI(
)
# TODO Create a nice welcome page
@app.get
(
"
/
"
)
@app.get
(
"
/
"
,
response_class
=
HTMLResponse
)
async
def
root
():
return
{
"
message
"
:
"
Hello World
"
}
return
_welcome_html
####### Model listing endpoints #######
...
...
@@ -181,4 +181,20 @@ def _result_or_404(result, model_id:str, response:Response):
return
result
else
:
response
.
status_code
=
status
.
HTTP_404_NOT_FOUND
return
{
"
ERROR
"
:
"
VIPS model with id=%s could not be found.
"
%
model_id
}
\ No newline at end of file
return
{
"
ERROR
"
:
"
VIPS model with id=%s could not be found.
"
%
model_id
}
_welcome_html
=
"""
<html>
<head>
<title>VIPSCore-Python</title>
</head>
<body>
<h1>VIPSCore-Python</h1>
<p>© 2023 <a href=
"
https://nibio.no/en
"
target=
"
new
"
>NIBIO</a></p>
<p>Python implementation of VIPSCore, to enable models written in Python.</p>
<p><a href=
"
docs/
"
>Endpoints documentation</a></p>
<p><a href=
"
https://gitlab.nibio.no/VIPS/VIPSCore-Python
"
target=
"
new
"
>Source code on NIBIO
'
s GitLab</a></p>
<p><a href=
"
https://gitlab.nibio.no/VIPS/documentation
"
target=
"
new
"
>VIPS technical documentation</a></p>
<p><a href=
"
https://nibio.no/en/subjects/plant-health/vips--a-digital-pest-prediction-platform
"
target=
"
new
"
>Read more about VIPS</a></p>
</body>
"""
\ No newline at end of file
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