diff --git a/litellm/llms/bedrock.py b/litellm/llms/bedrock.py index 586eaf4d8a5..8b05f0153ff 100644 --- a/litellm/llms/bedrock.py +++ b/litellm/llms/bedrock.py @@ -552,8 +552,8 @@ def _embedding_func_single( ## FORMAT EMBEDDING INPUT ## provider = model.split(".")[0] inference_params = copy.deepcopy(optional_params) + input = input.replace(os.linesep, " ") if provider == "amazon": - input = input.replace(os.linesep, " ") data = {"inputText": input, **inference_params} # data = json.dumps(data) elif provider == "cohere": @@ -577,7 +577,7 @@ def _embedding_func_single( try: response = client.invoke_model( body=body, - modelId="cohere.embed-multilingual-v3", + modelId=model, accept="*/*", contentType="application/json", ) diff --git a/litellm/tests/test_embedding.py b/litellm/tests/test_embedding.py index 5f104372873..bca0887ae37 100644 --- a/litellm/tests/test_embedding.py +++ b/litellm/tests/test_embedding.py @@ -153,6 +153,7 @@ def test_cohere_embedding3(): def test_bedrock_embedding_titan(): try: + litellm.set_verbose=True response = embedding( model="amazon.titan-embed-text-v1", input=["good morning from litellm, attempting to embed data", "lets test a second string for good measure"] @@ -160,7 +161,7 @@ def test_bedrock_embedding_titan(): print(f"response:", response) except Exception as e: pytest.fail(f"Error occurred: {e}") -# test_bedrock_embedding() +test_bedrock_embedding_titan() def test_bedrock_embedding_cohere(): try: @@ -173,7 +174,7 @@ def test_bedrock_embedding_cohere(): except Exception as e: pytest.fail(f"Error occurred: {e}") -test_bedrock_embedding_cohere() +# test_bedrock_embedding_cohere() # comment out hf tests - since hf endpoints are unstable def test_hf_embedding(): diff --git a/litellm/tests/test_proxy_gunicorn.py b/litellm/tests/test_proxy_gunicorn.py index 4d96ac259ff..9afd424d427 100644 --- a/litellm/tests/test_proxy_gunicorn.py +++ b/litellm/tests/test_proxy_gunicorn.py @@ -1,6 +1,6 @@ # #### What this tests #### # # Allow the user to easily run the local proxy server with Gunicorn -## LOCAL TESTING ONLY +# # LOCAL TESTING ONLY # import sys, os, subprocess # import traceback # from dotenv import load_dotenv