-
Notifications
You must be signed in to change notification settings - Fork 75
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
Changed litellm prints to tqdm and added execution metrics #45
Conversation
can you test the examples and check that the output is as intended? map.py in examples still prints out the LiteLLM calls, and then it's followed by a tqdm output |
lotus/models/lm.py
Outdated
@@ -24,19 +29,23 @@ def __init__( | |||
max_batch_size: int = 64, | |||
tokenizer: Tokenizer | None = None, | |||
max_cache_size: int = 1024, | |||
safe_mode: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove safe_mode
from LM
because its not used here anymore.
lotus/sem_ops/sem_extract.py
Outdated
@@ -47,6 +55,8 @@ def sem_extract( | |||
lotus.logger.debug(f"raw_outputs: {lm_output.outputs}") | |||
lotus.logger.debug(f"outputs: {postprocess_output.outputs}") | |||
|
|||
model.print_total_usage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do model.print_total_usage
everywhere only if we are in safe mode?
lotus/sem_ops/sem_topk.py
Outdated
estimated_quicksort_calls = 2 * len(docs) * np.log(len(docs)) | ||
estimated_total_calls = estimated_quickselect_calls + estimated_quicksort_calls | ||
estimated_total_tokens = lotus.settings.lm.count_tokens(sample_prompt) * estimated_total_calls | ||
print("Quicksort:") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the Quicksort
print, and similarly the Heap Sort
print.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sidjha1 Naive sort as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
Replaced litellm prints with tqdm progress bar and added the execution metrics (cost and tokens)
Safe_mode implementation:
sem_extract - completed
sem_map - completed
sem_agg - completed
sem_topk - completed
sem_join - completed
sem_filter - completed