Connie-Wild commited on
Commit
3087a2a
·
1 Parent(s): ffe7cb5
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -94,9 +94,10 @@ def estimate_gpu_memory(model_name: str) -> str:
94
  if usedStorage_gb is not None:
95
  result_lines.append("")
96
  result_lines.append(f"参考までに、該当リポジトリのファイルサイズは合計 {usedStorage_gb:.2f} GBです。")
97
- result_lines.append(f"仮にこれを全てモデルサイズとして推論時(1.5倍)、トレーニング時(4倍)の補正を適用すると概算GPUメモリ必要量は")
98
  result_lines.append(f"【推論】約 {usedStorage_gb * 1.5:.2f} GB")
99
- result_lines.append(f"【トレーニング】約 {usedStorage_gb * 4:.2f} GB")
 
100
  result_lines.append("となります。")
101
  return "\n".join(result_lines)
102
 
@@ -118,11 +119,12 @@ def estimate_gpu_memory(model_name: str) -> str:
118
  if precision in parameters:
119
  result_lines.append(f"【{precision}】 {parameters[precision]:,}")
120
 
121
- result_lines.append(f"これらを合算するとモデルのパラメータサイズは約 {estimated_gb:.2f} GB です。")
122
  result_lines.append("")
123
- result_lines.append(f"推論時(1.5倍)、トレーニング時(4倍)の補正を適用すると概算GPUメモリ必要量は")
124
  result_lines.append(f"【推論】約 {estimated_gb * 1.5:.2f} GB")
125
- result_lines.append(f"【トレーニング】約 {estimated_gb * 4:.2f} GB")
 
126
  result_lines.append("となります。")
127
 
128
  # GPU選定のコメント
@@ -142,7 +144,7 @@ iface = gr.Interface(
142
  inputs=gr.Textbox(label="モデル名 (例: meta-llama/Llama-3.3-70B-Instruct)"),
143
  outputs="text",
144
  title="Model memory estimator",
145
- description=("Hugging Face Hub APIから取得したsafetensorsの情報をもとに、すべてのパラメータのサイズを合計し、その合計値からGPUメモリの必要量を概算(GB単位)で計算します。")
146
  )
147
 
148
  iface.launch()
 
94
  if usedStorage_gb is not None:
95
  result_lines.append("")
96
  result_lines.append(f"参考までに、該当リポジトリのファイルサイズは合計 {usedStorage_gb:.2f} GBです。")
97
+ result_lines.append(f"これを全てモデルのデータとして仮定した場合、推論及び、トレーニングに必要な概算のGPUメモリサイズは")
98
  result_lines.append(f"【推論】約 {usedStorage_gb * 1.5:.2f} GB")
99
+ result_lines.append(f"【トレーニング(LoRA)】約 {usedStorage_gb * 2:.2f} GB")
100
+ result_lines.append(f"【トレーニング(フルパラメータ)】約 {usedStorage_gb * 4:.2f} GB")
101
  result_lines.append("となります。")
102
  return "\n".join(result_lines)
103
 
 
119
  if precision in parameters:
120
  result_lines.append(f"【{precision}】 {parameters[precision]:,}")
121
 
122
+ result_lines.append(f"これらを合算するとモデルのデータサイズは約 {estimated_gb:.2f} GB です。")
123
  result_lines.append("")
124
+ result_lines.append(f"推論及び、トレーニングに必要な概算のGPUメモリサイズは")
125
  result_lines.append(f"【推論】約 {estimated_gb * 1.5:.2f} GB")
126
+ result_lines.append(f"【トレーニング(LoRA)】約 {estimated_gb * 2:.2f} GB")
127
+ result_lines.append(f"【トレーニング(フルパラメータ)】約 {estimated_gb * 4:.2f} GB")
128
  result_lines.append("となります。")
129
 
130
  # GPU選定のコメント
 
144
  inputs=gr.Textbox(label="モデル名 (例: meta-llama/Llama-3.3-70B-Instruct)"),
145
  outputs="text",
146
  title="Model memory estimator",
147
+ description=("Hugging Face Hub APIから取得したsafetensorsの情報をもとに、すべてのパラメータのデータサイズを合計し、その合計値から必要なGPUメモリサイズを概算(GB単位)で計算します。")
148
  )
149
 
150
  iface.launch()