YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Google Colab L4での実行を想定しています。
!pip install vllm triton bitsandbytes
#メモリ使用量を削減しての読み込み
from vllm import LLM, SamplingParams
# Initialize the model with PagedAttention
llm = LLM(model="kota-kawa/Llama-3.1-8B-Instruct-Freedom_v3", max_model_len=2048, max_num_seqs=1)
# サンプリングパラメータの設定
sampling_params = SamplingParams(
temperature=0.7, # 出力の多様性を調整
top_p=0.9, # トップPサンプリング
max_tokens=2048 # 最大トークン数
)
# プロンプトの定義
prompt = """
私は市場へ行きリンゴを10個買いました。私はリンゴを2個隣の人に、もう2個を修理屋さんにあげました。それからリンゴをさらに5個買い、1個食べました。また、バナナを3本兄にあげました。リンゴは何個残ったでしょう?段階的に考えてみましょう。
"""
# LLMへの入力と出力取得
outputs = llm.generate([prompt], sampling_params)
# 出力の表示
for output in outputs:
print("Prompt:")
print(output.prompt)
for i, generated_output in enumerate(output.outputs):
print(f"Generated Output {i + 1}:")
print(generated_output.text)
- Downloads last month
- 4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support