changes modal entry + cognify batching

This commit is contained in:
hajdul88 2025-07-02 18:56:11 +02:00
parent 7429f3253c
commit e68b19ec83
2 changed files with 17 additions and 13 deletions

View file

@ -12,20 +12,24 @@ image = (
modal.Image.from_dockerfile(path="Dockerfile_modal", force_build=False) modal.Image.from_dockerfile(path="Dockerfile_modal", force_build=False)
.copy_local_file("pyproject.toml", "pyproject.toml") .copy_local_file("pyproject.toml", "pyproject.toml")
.copy_local_file("poetry.lock", "poetry.lock") .copy_local_file("poetry.lock", "poetry.lock")
.env( .pip_install(
{ "protobuf",
"ENV": os.getenv("ENV"), "h2",
"LLM_API_KEY": os.getenv("LLM_API_KEY"), "deepeval",
"OPENAI_API_KEY": os.getenv("OPENAI_API_KEY"), "gdown",
"AWS_ACCESS_KEY_ID": os.getenv("AWS_ACCESS_KEY_ID"), "plotly",
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_SECRET_ACCESS_KEY"), "psycopg2-binary==2.9.10",
} "asyncpg==0.30.0",
) )
.pip_install("protobuf", "h2", "deepeval", "gdown", "plotly")
) )
@app.function(image=image, max_containers=1, timeout=86400, min_containers=1) @app.function(
image=image,
max_containers=1,
timeout=86400,
secrets=[modal.Secret.from_name("1gb_nonparallel_cognee")],
)
async def run_cognee_1gb(): async def run_cognee_1gb():
await cognee.prune.prune_data() await cognee.prune.prune_data()
await cognee.prune.prune_system(metadata=True) await cognee.prune.prune_system(metadata=True)

View file

@ -151,13 +151,13 @@ async def get_default_tasks( # TODO: Find out a better way to do this (Boris's
extract_graph_from_data, extract_graph_from_data,
graph_model=graph_model, graph_model=graph_model,
ontology_adapter=OntologyResolver(ontology_file=ontology_file_path), ontology_adapter=OntologyResolver(ontology_file=ontology_file_path),
task_config={"batch_size": 10}, task_config={"batch_size": 50},
), # Generate knowledge graphs from the document chunks. ), # Generate knowledge graphs from the document chunks.
Task( Task(
summarize_text, summarize_text,
task_config={"batch_size": 10}, task_config={"batch_size": 50},
), ),
Task(add_data_points, task_config={"batch_size": 10}), Task(add_data_points, task_config={"batch_size": 50}),
] ]
return default_tasks return default_tasks