Declare the `model_folder_path` variable outside the try-catch statement
Browse files
app.py
CHANGED
@@ -121,9 +121,10 @@ class ModelConverter:
|
|
121 |
|
122 |
def upload_model(self, input_model_id: str, output_model_id: str) -> Optional[str]:
|
123 |
"""Upload the converted model to Hugging Face."""
|
|
|
|
|
124 |
try:
|
125 |
self.api.create_repo(output_model_id, exist_ok=True, private=False)
|
126 |
-
model_folder_path = self.config.repo_path / "models" / input_model_id
|
127 |
|
128 |
readme_path = f"{model_folder_path}/README.md"
|
129 |
|
|
|
121 |
|
122 |
def upload_model(self, input_model_id: str, output_model_id: str) -> Optional[str]:
|
123 |
"""Upload the converted model to Hugging Face."""
|
124 |
+
model_folder_path = self.config.repo_path / "models" / input_model_id
|
125 |
+
|
126 |
try:
|
127 |
self.api.create_repo(output_model_id, exist_ok=True, private=False)
|
|
|
128 |
|
129 |
readme_path = f"{model_folder_path}/README.md"
|
130 |
|