Spaces:
Running
Running
fix
Browse files115 unmodified lines116117118119120121122115 unmodified lines],outputs=[gr.Markdown(label="output"),gr.Image(show_label=False),],submit_btn=gr.Button("Export"),title=TITLE,115 unmodified lines116117118119120121115 unmodified lines],outputs=[gr.Markdown(label="output"),],submit_btn=gr.Button("Export"),title=TITLE,
29 unmodified lines30313233343513 unmodified lines49505152535429 unmodified lines)from optimum.intel.utils.constant import _TASK_ALIASESfrom optimum.intel.openvino.utils import _HEAD_TO_AUTOMODELSSPACES_URL = "https://huggingface.co/spaces/echarlaix/openvino-export"13 unmodified linesdef convert_openvino(model_id: str, task: str, folder: str) -> List:task = _TASK_ALIASES.get(task, task)if task not in _HEAD_TO_AUTOMODELS:raise ValueError(f"The task '{task}' is not supported, only {_HEAD_TO_AUTOMODELS.keys()} tasks are supported")29 unmodified lines3031323334353613 unmodified lines50515253545556575859606162636429 unmodified lines)from optimum.intel.utils.constant import _TASK_ALIASESfrom optimum.intel.openvino.utils import _HEAD_TO_AUTOMODELSfrom optimum.exporters import TasksManagerSPACES_URL = "https://huggingface.co/spaces/echarlaix/openvino-export"13 unmodified linesdef convert_openvino(model_id: str, task: str, folder: str) -> List:task = TasksManager.map_from_synonym(task)if task == "auto":try:task = TasksManager.infer_task_from_model(model_id)except KeyError as e:raise KeyError(f"The task could not be automatically inferred. Please provide the task argument with the relevant task from {', '.join(TasksManager.get_all_tasks())}. {e}")task = _TASK_ALIASES.get(task, task)if task not in _HEAD_TO_AUTOMODELS:raise ValueError(f"The task '{task}' is not supported, only {_HEAD_TO_AUTOMODELS.keys()} tasks are supported")
app.py-1
export.py+10