forked from phoenix/litellm-mirror
(chore) util: remove_model_id
This commit is contained in:
parent
7a38a45d62
commit
2c74dbed17
1 changed files with 10 additions and 1 deletions
|
@ -5846,4 +5846,13 @@ def transform_logprobs(hf_response):
|
||||||
# Add the 'token_info' list to the 'transformed_logprobs' list
|
# Add the 'token_info' list to the 'transformed_logprobs' list
|
||||||
transformed_logprobs = token_info
|
transformed_logprobs = token_info
|
||||||
|
|
||||||
return transformed_logprobs
|
return transformed_logprobs
|
||||||
|
|
||||||
|
# used in LiteLLM Router
|
||||||
|
def remove_model_id(original_model_string):
|
||||||
|
# Find the index of "ModelID" in the string
|
||||||
|
index_of_model_id = original_model_string.find("-ModelID")
|
||||||
|
# Remove everything after "-ModelID" if it exists
|
||||||
|
if index_of_model_id != -1:
|
||||||
|
return original_model_string[:index_of_model_id]
|
||||||
|
return original_model_string
|
Loading…
Add table
Add a link
Reference in a new issue