|
125 | 125 | height="24" |
126 | 126 | /> |
127 | 127 | <RepoHeaderSourceIcon |
128 | | - v-if="!!repoSource" |
| 128 | + v-if="!!repoSource && false" |
129 | 129 | :repoType="repoType" |
130 | 130 | :source="repoSource" |
131 | 131 | :sourcePath="repoSourcePath" |
|
184 | 184 | </el-tooltip> |
185 | 185 | </div> |
186 | 186 | </div> |
187 | | - |
| 187 | + <div v-if="!!repoSource && repoSourcePath" class="flex flex-wrap w-full gap-1 items-center"> |
| 188 | + <SvgIcon |
| 189 | + :name="iconSrc" |
| 190 | + width="24" |
| 191 | + height="24" |
| 192 | + class="flex-shrink-0 cursor-pointer" /> |
| 193 | + <div class="text-center text-gray-500 text-md font-normal leading-normal"> {{ $t('all.mirrorSource') }}: </div> |
| 194 | + <a :href='sourceUrl' target='_blank' class='text-slate-700 text-md font-normal leading-normal hover:underline hover:text-brand-700' rel='noopener noreferrer'> |
| 195 | + {{ repoSourcePath }} |
| 196 | + </a> |
| 197 | + </div> |
188 | 198 | <div |
189 | 199 | class="flex gap-2 items-center" |
190 | 200 | v-if="repoType !== 'finetune'"> |
|
390 | 400 | } |
391 | 401 | }) |
392 | 402 |
|
| 403 | + const iconSrc = computed(() => { |
| 404 | + if (repoSource.value === 'HuggingFace') { |
| 405 | + return 'repo_source_huggingface' |
| 406 | + } else if (repoSource.value === 'ModelScope') { |
| 407 | + return 'repo_source_modelscope' |
| 408 | + } else { |
| 409 | + return 'repo_source_opencsg' |
| 410 | + } |
| 411 | + }) |
| 412 | +
|
| 413 | + const sourceUrl = computed(() => { |
| 414 | + if (!repoSourcePath.value) { |
| 415 | + return ''; |
| 416 | + } |
| 417 | +
|
| 418 | + if (repoSource.value === 'HuggingFace') { |
| 419 | + if (props.repoType === 'model') { |
| 420 | + return `https://huggingface.co/${repoSourcePath.value}` |
| 421 | + } else { |
| 422 | + return `https://huggingface.co/${props.repoType}s/${repoSourcePath.value}` |
| 423 | + } |
| 424 | + } else if (repoSource.value === 'ModelScope') { |
| 425 | + return `https://modelscope.cn/${props.repoType}s/${repoSourcePath.value}` |
| 426 | + } else { |
| 427 | + return `https://opencsg.com/${props.repoType}s/${repoSourcePath.value}` |
| 428 | + } |
| 429 | + }) |
| 430 | +
|
393 | 431 | const repoSource = computed(() => { |
394 | 432 | if (repoDetailStore.hfPath) { |
395 | 433 | return 'HuggingFace' |
|
0 commit comments