[LFX] Enhanced cloud-edge-collaborative-inference-for-llm example #188
Conversation
ab03606 to
c0767d8
Compare
|
/kind enhancement |
|
@AryanNanda17: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
c0767d8 to
fe22b2e
Compare
|
Since groq doesn't support the usage options, I have done an approximation of prompt_tokens = len(messages[0]['content'].split()) # Approximate
completion_tokens = len(text.split()) # ApproximateFor more accuracy we can use a tokenizer compatible with the model to estimate token counts accurately. A common approach is to use the That is:- self.tokenizer = tiktoken.get_encoding("cl100k_base")
prompt_text = "".join([msg["content"] for msg in messages if msg["content"]])
prompt_tokens = len(self.tokenizer.encode(prompt_text))
completion_tokens = len(self.tokenizer.encode(text))What would you recommend to go with? |
There was a problem hiding this comment.
Good to see that all suggestions from other reviewers are properly tackled.
Just some tiny logistics consideration:
- It aims to build the cloud-edge-collaborative-inference-for-llm example. The purpose can be specified in the title and description to make it clear to community members. We also need to squash the commits into one.
- The CI test for this PR is not yet past, and might not be wrong for this PR. But we should have the CI pass before merging this PR.
- It would be appreciated to update the dataset link, as specified below.
ef20a47 to
f4e8c9f
Compare
|
To do:-
|
|
@FuryMartin , could you please share with me the updated dataset link? |
90d61cb to
284c2f6
Compare
089f6f1 to
4f7d591
Compare
ba8de50 to
51cca08
Compare
|
@FuryMartin: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
51cca08 to
2a1d15f
Compare
dataset instructions changed from hugging face to kaggle matplotlib added to requirements.txt dataset instructions changed from hugging face to kaggle dataset instructions changed from hugging face to kaggle dataset instructions changed from hugging face to kaggle Signed-off-by: Aryan Nanda <nandaaryan823@gmail.com> changes in readme of cloud-edge-collaborative-inference done to use kaggle instead of huggingface Signed-off-by: Aryan <nandaaryan823@gmail.com> readme file updated Signed-off-by: Aryan <nandaaryan823@gmail.com> print changed to logger Signed-off-by: Aryan <nandaaryan823@gmail.com>
2a1d15f to
46340c8
Compare
|
@MooreZheng @FuryMartin @hsj576 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FuryMartin, hsj576, MooreZheng The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The example "Cloud-Edge Collaborative Inference for LLM" is well-structured. This PR improves few areas of the example to make it a fully functional quick-start guide with minimal errors.
The changes done does the following:-
api_provider,api_base_urlandapi_key_envparameters to cloudmodel in test_queryrouting.yaml file.Note:- This PR is an implementation of point 1 of #185. This PR comes under LFX Spring Term 2025 project "Enhancing Dependency Management and Documentation of ianvs".
Fixes #178