導入
watsonx.ai LLM にアクセスするユーザーにとってよくある質問は、「サンプリング パラメーターをどのように設定すればよいですか?」というものです。 !
実際、それは非常に簡単です。
サンプリングパラメータ(または生成パラメータ)
- watsonx.ai インスタンスにアクセスします。
- 「プロンプト ラボを開く」をクリックします。プロンプト ラボに入ったら、いずれかのタブでパラメータ アイコン (図の右端のアイコン) をクリックします。
設定されている LLM (以前に使用したもの、またはデフォルトで設定されたもの) を変更できます。
- パラメータ ダイアログ ボックスが開いたら、必要に応じて設定できます。
- パラメータを設定したら、同じツール アイコン セットで [コードを表示 >] を選択します。
インターフェイスは、パラメーターの実装を埋め込む 3 種類のコードを提供します。以下のサンプルとして Curl、Node.js、Python を使用します。
curl "https://us-south.ml.cloud.ibm.com/ml/v1/text/generation?version=2023-05-29" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Bearer ${YOUR_ACCESS_TOKEN}" \ -d '{ "input": "systemYou are Granite, an AI language model developed by IBM in 2024. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.\nassistant", "parameters": { "decoding_method": "sample", "max_new_tokens": 200, "min_new_tokens": 100, "random_seed": 42, "stop_sequences": [], "temperature": 0.7, "top_k": 50, "top_p": 1, "repetition_penalty": 1 }, "model_id": "ibm/granite-3-8b-instruct", "project_id": "the one you get" }'
export const generateText = async () => { const url = "https://us-south.ml.cloud.ibm.com/ml/v1/text/generation?version=2023-05-29"; const headers = { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer YOUR_ACCESS_TOKEN" }; const body = { input: "systemYou are Granite, an AI language model developed by IBM in 2024. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.\nassistant", parameters: { decoding_method: "sample", max_new_tokens: 200, min_new_tokens: 100, random_seed: 42, stop_sequences: [], temperature: 0.7, top_k: 50, top_p: 1, repetition_penalty: 1 }, model_id: "ibm/granite-3-8b-instruct", project_id: "the-one-you-get" }; const response = await fetch(url, { headers, method: "POST", body: JSON.stringify(body) }); if (!response.ok) { throw new Error("Non-200 response"); } return await response.json(); }
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v1/text/generation?version=2023-05-29" body = { "input": """systemYou are Granite, an AI language model developed by IBM in 2024. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior. assistant""", "parameters": { "decoding_method": "sample", "max_new_tokens": 200, "min_new_tokens": 100, "random_seed": 42, "temperature": 0.7, "top_k": 50, "top_p": 1, "repetition_penalty": 1 }, "model_id": "ibm/granite-3-8b-instruct", "project_id": "the-one-you-get" } headers = { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer YOUR_ACCESS_TOKEN" } response = requests.post( url, headers=headers, json=body ) if response.status_code != 200: raise Exception("Non-200 response: " + str(response.text)) data = response.json()
開発者が調整する必要がある唯一の情報はアクセス トークンです。
それで、出来上がり?
結論
watsonx.ai プラットフォームを使用すると、アプリケーション開発者は LLM サンプリング パラメーターのセットを非常に簡単に調整できます。
以上がwatsonxを使用してアプリケーションのすべての「サンプリングパラメータ」または「生成パラメータ」を簡単に設定するにはどうすればよいですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

Pythonリストスライスの基本的な構文はリストです[start:stop:step]。 1.STARTは最初の要素インデックス、2。ストップは除外された最初の要素インデックスであり、3.ステップは要素間のステップサイズを決定します。スライスは、データを抽出するためだけでなく、リストを変更および反転させるためにも使用されます。

ListSoutPerformArraysIn:1)ダイナミシジョンアンドフレーケンティオン/削除、2)ストーリングヘテロゼンダタ、および3)メモリ効率の装飾、ButmayhaveslightPerformancostsinceNASOPERATIONS。

toconvertapythonarraytoalist、usetheList()constructororageneratorexpression.1)importhearraymoduleandcreateanarray.2)useList(arr)または[xforxinarr] toconvertoalistは、largedatatessを変えることを伴うものです。

choosearraysoverlistsinperbetterperformance andmemoryeficiencyspecificscenarios.1)largeNumericaldatasets:Araysreducememoryusage.2)パフォーマンス - クリティカル操作:ArraysOfferSpeedBoostsfortsfortsclikeappendedoring.3)タイプリー:Arrayesenforc

Pythonでは、ループに使用し、列挙し、包括的なリストを通過することができます。 Javaでは、従来のループを使用し、ループを強化してアレイを通過することができます。 1。Pythonリストトラバーサル方法は、ループ、列挙、およびリスト理解のためのものです。 2。Javaアレイトラバーサル法には、従来のループとループ用の強化が含まれます。

この記事では、バージョン3.10で導入されたPythonの新しい「マッチ」ステートメントについて説明します。これは、他の言語のスイッチステートメントに相当するものです。コードの読みやすさを向上させ、従来のif-elif-elよりもパフォーマンスの利点を提供します

Python 3.11の例外グループは、複数の例外を同時に処理することで、同時シナリオと複雑な操作でエラー管理を改善します。

Pythonの関数注釈は、タイプチェック、ドキュメント、およびIDEサポートの関数にメタデータを追加します。それらはコードの読みやすさ、メンテナンスを強化し、API開発、データサイエンス、ライブラリの作成において重要です。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

DVWA
Damn Vulnerable Web App (DVWA) は、非常に脆弱な PHP/MySQL Web アプリケーションです。その主な目的は、セキュリティ専門家が法的環境でスキルとツールをテストするのに役立ち、Web 開発者が Web アプリケーションを保護するプロセスをより深く理解できるようにし、教師/生徒が教室環境で Web アプリケーションを教え/学習できるようにすることです。安全。 DVWA の目標は、シンプルでわかりやすいインターフェイスを通じて、さまざまな難易度で最も一般的な Web 脆弱性のいくつかを実践することです。このソフトウェアは、

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 英語版
推奨: Win バージョン、コードプロンプトをサポート!

ホットトピック









