2024年11月– date –
-
SageMakerでデプロイしたMeta Llama GuardでNemo Guardrailsを動かしてみた
Nemo GuardrailsではMeta Llama Guardを使用したllama guard check input とllama guard check output あ利用できます。これらをこれらをSageMakerのエンドポイントで動かす方法を解説します。 Nemo Guardrailsの設定 config.yaml railsの設定は公式のドキュメントの通りです。mainのモデルにはChatGPT 4oを使用しています。 rails: input: flows: - llama guard check input output: flows: - llama guard check output models: - type: main engine: openai model: "gpt-4o" parameters: temperature:... -
Nemo GuardrailsのHelloWorldをOpenAIで動かしてみた
Nemo Guardrailsを学習中です。NVIDIAのサイト(NeMo Guardrails により LLM の脆弱性を防ぐ: 導入編)だとNVIDIA AI Endpointsを使っているのですがNVIDIAのAPIキーを持っていないのでOpenAIで動かしてみました。 インストール nemoguardrailsとlangchain-openaiをインストールします。しかし、2024/11/8時点でそれぞれ最新版をインストールすると以下のエラーが出て動きません。 TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all i... -
Unable to find model manifest for ‘some-model’ with version ‘*’ compatible with your SageMaker version (‘2.224.1’).の対処法
2024/11/6時点においてSageMakerのJumpStartで Meta Llama Guard 3 8B を動かそうとしたところ、モデルを定義する際にエラーが発生しました。その時の対処法をご紹介します。 事象 SageMakerのJumpStartからMeta Llama Guard 3 8B をStudioノートブックで開き、上から順に実行して以下のコードを実行したところでエラーとなりました。 model = JumpStartModel(model_id=model_id) エラーメッセージは以下の通りです。 KeyError: "Unable to find model manifest for 'meta-textgeneration-llama-guard-3-8b' with ... -
“code”:424,”message”:”Batch inference failed”の対処法
SageMakerでモデルをデプロイして、エンドポイントをAPIで呼び出したところ、レスポンスに"code":424,"message":"Batch inference failed" が返されました。この事象に対する対応方法を紹介します。 事象 SageMakerでモデルをデプロイして、エンドポイントをAPIで呼び出す以下のコードを実行しました。 import boto3 import json client = boto3.client('sagemaker-runtime') endpoint_name = "my-endpoint-name" content_type = "text/plain" accept = "text/plain" paylo...
1