Remove task inference from the Card Model (based on `pipeline_tag`
Browse filesattribute)
Because the conversion script alrady handles task detection
automatically (based on `config.json`).
app.py
CHANGED
|
@@ -337,19 +337,6 @@ class ModelConverter:
|
|
| 337 |
if output_attentions:
|
| 338 |
conversion_args.append("--output_attentions")
|
| 339 |
|
| 340 |
-
# Try to infer the task from model metadata and pass it to the conversion script
|
| 341 |
-
# This helps the script choose the right export configuration
|
| 342 |
-
try:
|
| 343 |
-
info = model_info(repo_id=input_model_id, token=self.config.hf_token)
|
| 344 |
-
pipeline_tag = getattr(info, "pipeline_tag", None)
|
| 345 |
-
task = self._normalize_pipeline_tag(pipeline_tag)
|
| 346 |
-
if task:
|
| 347 |
-
conversion_args.extend(["--task", task])
|
| 348 |
-
except Exception:
|
| 349 |
-
# If we can't fetch the task, continue without it
|
| 350 |
-
# The conversion script will try to infer it automatically
|
| 351 |
-
pass
|
| 352 |
-
|
| 353 |
# Run the conversion
|
| 354 |
result = self._run_conversion_subprocess(
|
| 355 |
input_model_id, extra_args=conversion_args or None
|
|
|
|
| 337 |
if output_attentions:
|
| 338 |
conversion_args.append("--output_attentions")
|
| 339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
# Run the conversion
|
| 341 |
result = self._run_conversion_subprocess(
|
| 342 |
input_model_id, extra_args=conversion_args or None
|