style: formatting and fixes

This commit is contained in:
Gabriel Almeida 2023-03-14 11:00:56 -03:00
commit fcb3abccf1
6 changed files with 8 additions and 14 deletions

View file

@ -18,7 +18,7 @@ format:
lint:
poetry run mypy .
poetry run black . --check
poetry run ruff .
poetry run ruff . --fix
install_frontend:
cd langflow/frontend && npm install

View file

@ -1 +1 @@
from langflow_backend.interface.loading import load_flow_from_json
from langflow_backend.interface.loading import load_flow_from_json # noqa

View file

@ -1,5 +1,4 @@
import multiprocessing
import os
import platform
from langflow_backend.main import create_app
@ -10,16 +9,14 @@ from pathlib import Path
def get_number_of_workers(workers=None):
if workers is None:
workers = 1
elif workers == -1:
if workers == -1:
workers = (multiprocessing.cpu_count() * 2) + 1
return workers
def serve(
workers: int = None,
timeout: int = None,
workers: int = 1,
timeout: int = 60,
):
app = create_app()
# get the directory of the current file
@ -31,9 +28,6 @@ def serve(
name="static",
)
if not timeout:
timeout = 60
host = "127.0.0.1"
port = 5003
options = {

View file

@ -120,7 +120,7 @@ def get_tool_signature(name: str):
template["aiosession"]["required"] = False
template["aiosession"]["show"] = False
template["_type"] = tool_type
template["_type"] = tool_type # type: ignore
return {
"template": template,

View file

@ -1,4 +1,4 @@
from gunicorn.app.base import BaseApplication
from gunicorn.app.base import BaseApplication # type: ignore
class LangflowApplication(BaseApplication):

View file

@ -1,5 +1,5 @@
from pathlib import Path
from langflow import load_flow_from_json
from langflow_backend import load_flow_from_json
def test_load_flow_from_json():