Skip to content

Commit

Permalink
Merge pull request #47 from sweepai/increase-time-limits
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlu1248 authored Jun 23, 2023
2 parents 05431ed + f5cb511 commit c13e2b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/vector_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
DEEPLAKE_FOLDER = "deeplake/"
BATCH_SIZE = 256
SENTENCE_TRANSFORMERS_MODEL = "sentence-transformers/all-MiniLM-L12-v2"
timeout = 60 * 30 # 30 minutes

image = (
modal.Image.debian_slim()
Expand Down Expand Up @@ -229,7 +230,7 @@ def get_deeplake_vs_from_repo(
logger.error("No documents found in repository")
return deeplake_vs

@stub.function(image=image, secrets=secrets, timeout=15 * 60, shared_volumes={DISKCACHE_DIR: model_volume})
@stub.function(image=image, secrets=secrets, timeout=15 * 60, shared_volumes={DISKCACHE_DIR: model_volume}, timeout=timeout)
def init_index(
repo_name: str,
installation_id: int,
Expand All @@ -238,7 +239,7 @@ def init_index(
pass


@stub.function(image=image, secrets=secrets, timeout=30 * 60, shared_volumes={DISKCACHE_DIR: model_volume})
@stub.function(image=image, secrets=secrets, timeout=30 * 60, shared_volumes={DISKCACHE_DIR: model_volume}, timeout=timeout)
def update_index(
repo_name,
installation_id: int,
Expand All @@ -247,7 +248,7 @@ def update_index(
pass


@stub.function(image=image, secrets=secrets, shared_volumes={DEEPLAKE_DIR: model_volume})
@stub.function(image=image, secrets=secrets, shared_volumes={DEEPLAKE_DIR: model_volume}, timeout=timeout)
def get_relevant_snippets(
repo_name: str,
query: str,
Expand Down

0 comments on commit c13e2b9

Please sign in to comment.