Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Llama Index
Commits
1a688d76
Unverified
Commit
1a688d76
authored
11 months ago
by
Yue Fei
Committed by
GitHub
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add retry for batch runner (#12647)
parent
f26bbf35
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llama-index-core/llama_index/core/evaluation/batch_runner.py
+16
-0
16 additions, 0 deletions
llama-index-core/llama_index/core/evaluation/batch_runner.py
with
16 additions
and
0 deletions
llama-index-core/llama_index/core/evaluation/batch_runner.py
+
16
−
0
View file @
1a688d76
import
asyncio
import
asyncio
from
tenacity
import
retry
,
stop_after_attempt
,
wait_exponential
from
typing
import
Any
,
Dict
,
List
,
Optional
,
Sequence
,
Tuple
,
cast
from
typing
import
Any
,
Dict
,
List
,
Optional
,
Sequence
,
Tuple
,
cast
from
llama_index.core.async_utils
import
asyncio_module
from
llama_index.core.async_utils
import
asyncio_module
...
@@ -7,6 +8,11 @@ from llama_index.core.base.response.schema import RESPONSE_TYPE, Response
...
@@ -7,6 +8,11 @@ from llama_index.core.base.response.schema import RESPONSE_TYPE, Response
from
llama_index.core.evaluation.base
import
BaseEvaluator
,
EvaluationResult
from
llama_index.core.evaluation.base
import
BaseEvaluator
,
EvaluationResult
@retry
(
reraise
=
True
,
stop
=
stop_after_attempt
(
3
),
wait
=
wait_exponential
(
multiplier
=
1
,
min
=
4
,
max
=
10
),
)
async
def
eval_response_worker
(
async
def
eval_response_worker
(
semaphore
:
asyncio
.
Semaphore
,
semaphore
:
asyncio
.
Semaphore
,
evaluator
:
BaseEvaluator
,
evaluator
:
BaseEvaluator
,
...
@@ -26,6 +32,11 @@ async def eval_response_worker(
...
@@ -26,6 +32,11 @@ async def eval_response_worker(
)
)
@retry
(
reraise
=
True
,
stop
=
stop_after_attempt
(
3
),
wait
=
wait_exponential
(
multiplier
=
1
,
min
=
4
,
max
=
10
),
)
async
def
eval_worker
(
async
def
eval_worker
(
semaphore
:
asyncio
.
Semaphore
,
semaphore
:
asyncio
.
Semaphore
,
evaluator
:
BaseEvaluator
,
evaluator
:
BaseEvaluator
,
...
@@ -46,6 +57,11 @@ async def eval_worker(
...
@@ -46,6 +57,11 @@ async def eval_worker(
)
)
@retry
(
reraise
=
True
,
stop
=
stop_after_attempt
(
3
),
wait
=
wait_exponential
(
multiplier
=
1
,
min
=
4
,
max
=
10
),
)
async
def
response_worker
(
async
def
response_worker
(
semaphore
:
asyncio
.
Semaphore
,
semaphore
:
asyncio
.
Semaphore
,
query_engine
:
BaseQueryEngine
,
query_engine
:
BaseQueryEngine
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment