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:
|
lint:
|
||||||
poetry run mypy .
|
poetry run mypy .
|
||||||
poetry run black . --check
|
poetry run black . --check
|
||||||
poetry run ruff .
|
poetry run ruff . --fix
|
||||||
|
|
||||||
install_frontend:
|
install_frontend:
|
||||||
cd langflow/frontend && npm install
|
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 multiprocessing
|
||||||
import os
|
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
from langflow_backend.main import create_app
|
from langflow_backend.main import create_app
|
||||||
|
|
@ -10,16 +9,14 @@ from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def get_number_of_workers(workers=None):
|
def get_number_of_workers(workers=None):
|
||||||
if workers is None:
|
if workers == -1:
|
||||||
workers = 1
|
|
||||||
elif workers == -1:
|
|
||||||
workers = (multiprocessing.cpu_count() * 2) + 1
|
workers = (multiprocessing.cpu_count() * 2) + 1
|
||||||
return workers
|
return workers
|
||||||
|
|
||||||
|
|
||||||
def serve(
|
def serve(
|
||||||
workers: int = None,
|
workers: int = 1,
|
||||||
timeout: int = None,
|
timeout: int = 60,
|
||||||
):
|
):
|
||||||
app = create_app()
|
app = create_app()
|
||||||
# get the directory of the current file
|
# get the directory of the current file
|
||||||
|
|
@ -31,9 +28,6 @@ def serve(
|
||||||
name="static",
|
name="static",
|
||||||
)
|
)
|
||||||
|
|
||||||
if not timeout:
|
|
||||||
timeout = 60
|
|
||||||
|
|
||||||
host = "127.0.0.1"
|
host = "127.0.0.1"
|
||||||
port = 5003
|
port = 5003
|
||||||
options = {
|
options = {
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ def get_tool_signature(name: str):
|
||||||
template["aiosession"]["required"] = False
|
template["aiosession"]["required"] = False
|
||||||
template["aiosession"]["show"] = False
|
template["aiosession"]["show"] = False
|
||||||
|
|
||||||
template["_type"] = tool_type
|
template["_type"] = tool_type # type: ignore
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"template": template,
|
"template": template,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from gunicorn.app.base import BaseApplication
|
from gunicorn.app.base import BaseApplication # type: ignore
|
||||||
|
|
||||||
|
|
||||||
class LangflowApplication(BaseApplication):
|
class LangflowApplication(BaseApplication):
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
from pathlib import Path
|
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():
|
def test_load_flow_from_json():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue