- We use python 3.10 please install it
pip install poetry
(1.2+)
poetry install --with backend,torch
- for Mac, Linux and CPU
- use env_setup.sh
- for Windows and CPU
- read this first
- use evn_setup.ps1
- Install virtualenv
- python3 -m pip install --user virtualenv
- Create venv
- python3 -m venv ./venv
- Activate venv
- On Linux and Mac
- source ./venv/bin/activate
- On Windows 7+
- venv/bin/Activate.ps1
- On Linux and Mac
- Install requirements
- pip3 install -r requirments.txt
Practice 2: Web app text sentiment recognition using Streamlit
- Streamlit lives here and should be run with this backend
- Run
uvicorn backend:app
to use web API - Use HTTP request to know sentence sentiment as result of your sentence processing
- Install docker on your system
- From the project dir run
docker build -t api .
whereapi
- tag for image and.
is where project Dockerfile is - After build the project run
docker run -d --name ml_urfu -p 80:80 api
where-d
detached launch--name
name for the app-p 80:80
mapping outside:inside portsapi
built image
Server will be available on your_ip_address:80
e.g. 192.168.1.1:80
or 127.0.0.1:80
You can check the server availability using http://your_ip_here:80/info
Answer should be like:
{
"root": "/",
"get_info": "/info",
"create_prediction": "/predict",
"docs": "/docs"
}
- Install project using Poetry
poetry install --with backend,torch,tests
- Run tests
poetry run pytest
(you must be in the project folder)