Skip to content

Commit

Permalink
Merge pull request #50 from lehors/fix_config
Browse files Browse the repository at this point in the history
Fix handling of url during import of model file
  • Loading branch information
lehors authored Nov 14, 2024
2 parents b7c4f40 + 1cf7cec commit ab6ce54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web/modules/mof/src/ModelUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ public function update(ModelInterface $model, array $model_data): int {
else if ($field === 'date') {
$model->set('changed', strtotime($value));
}
else if ($field === 'github') {
$parsed = parse_url($value);
if (isset($parsed['path'])) {
$model->set('github', ltrim($parsed['path'], '/'));
}
}
else if ($field === 'huggingface') {
$parsed = parse_url($value);
if (isset($parsed['path'])) {
$model->set('huggingface', ltrim($parsed['path'], '/'));
}
}
else {
$model->set($field, $value);
}
Expand Down

0 comments on commit ab6ce54

Please sign in to comment.