Skip to content

Commit

Permalink
fix: fix crash when model name not ready
Browse files Browse the repository at this point in the history
Signed-off-by: James <james@jan.ai>
  • Loading branch information
James committed May 21, 2024
1 parent ae499c7 commit f4ebb1d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ const ModelSegmentInfo: React.FC = () => {
)

const { author, modelName, downloads, modelUrl } = useMemo(() => {
const author =
(importingHuggingFaceRepoData?.cardData['model_creator'] as string) ??
'N/A'
const cardData = importingHuggingFaceRepoData?.cardData
const author = cardData?.['model_creator'] ?? 'N/A'
const modelName =
(importingHuggingFaceRepoData?.cardData['model_name'] as string) ?? 'N/A'
cardData?.['model_name'] ?? importingHuggingFaceRepoData.id ?? 'N/A'
const modelUrl = importingHuggingFaceRepoData?.modelUrl ?? 'N/A'
const downloads = importingHuggingFaceRepoData?.downloads ?? 0

Expand Down

0 comments on commit f4ebb1d

Please sign in to comment.