style: formatting and fixes
This commit is contained in:
parent
b5a9b558d2
commit
fcb3abccf1
6 changed files with 8 additions and 14 deletions
2
Makefile
2
Makefile
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
from langflow_backend.interface.loading import load_flow_from_json
|
||||
from langflow_backend.interface.loading import load_flow_from_json # noqa
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from gunicorn.app.base import BaseApplication
|
||||
from gunicorn.app.base import BaseApplication # type: ignore
|
||||
|
||||
|
||||
class LangflowApplication(BaseApplication):
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue