Print a table of models.
(models: list[dict])
| 177 | |
| 178 | |
| 179 | def print_model_table(models: list[dict]) -> None: |
| 180 | """Print a table of models.""" |
| 181 | table = Table(title=t("download_list_title")) |
| 182 | table.add_column("Name", style="bold") |
| 183 | table.add_column("Repository") |
| 184 | table.add_column("Type") |
| 185 | table.add_column("Requirements") |
| 186 | |
| 187 | for model in models: |
| 188 | reqs = [] |
| 189 | if model.get("gpu_vram_gb"): |
| 190 | reqs.append(f"GPU: {model['gpu_vram_gb']}GB") |
| 191 | if model.get("cpu_ram_gb"): |
| 192 | reqs.append(f"RAM: {model['cpu_ram_gb']}GB") |
| 193 | |
| 194 | table.add_row( |
| 195 | model.get("name", ""), |
| 196 | model.get("hf_repo", ""), |
| 197 | model.get("type", ""), |
| 198 | ", ".join(reqs) if reqs else "-", |
| 199 | ) |
| 200 | |
| 201 | console.print(table) |
| 202 | |
| 203 | |
| 204 | def print_hardware_info(gpu_info: str, cpu_info: str, ram_info: str) -> None: |