Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update llama.cpp #99

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llama.cpp
Submodule llama.cpp updated 211 files
11 changes: 7 additions & 4 deletions skynet/modules/ttt/summaries/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ async def _run_job(job: Job) -> None:

await update_job(job_id=job.id, start=start, status=JobStatus.RUNNING, worker_id=worker_id)

customer_id = job.metadata.customer_id
processor = get_job_processor(customer_id) # may have changed since job was created

# add to running jobs list if not already there (which may occur on multiple worker disconnects while running the same job)
if job.id not in await db.lrange(RUNNING_JOBS_KEY, 0, -1):
await db.rpush(RUNNING_JOBS_KEY, job.id)
Expand All @@ -147,10 +150,8 @@ async def _run_job(job: Job) -> None:
result = job.payload.text
else:
try:
customer_id = job.metadata.customer_id
options = get_credentials(customer_id)
secret = options.get('secret')
processor = get_job_processor(customer_id) # may have changed since job was created

if processor == Processors.OPENAI:
log.info(f"Forwarding inference to OpenAI for customer {customer_id}")
Expand All @@ -176,15 +177,17 @@ async def _run_job(job: Job) -> None:
has_failed = True
result = str(e)

should_expire = not has_failed or processor != Processors.LOCAL

updated_job = await update_job(
expires=redis_exp_seconds if not has_failed else None,
expires=redis_exp_seconds if should_expire else None,
job_id=job.id,
end=time.time(),
status=JobStatus.ERROR if has_failed else JobStatus.SUCCESS,
result=result,
)

if has_failed:
if not should_expire:
await db.rpush(ERROR_JOBS_KEY, job.id)
SUMMARY_ERROR_COUNTER.inc()

Expand Down