Skip to content

Commit

Permalink
fix: import from HuggingFace with random string is causing app crash (j…
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Mar 3, 2024
1 parent b70e7fb commit 1bdf791
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion web/hooks/useGetHFRepoData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const useGetHFRepoData = () => {
const data = await res.json()
setRepoData(data)
} catch (err) {
setFetchError(err as Error)
setFetchError(
Error("The repo does not exist or you don't have access to it.")
)
}
setLoading(false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const HuggingFaceRepoDataLoadedModal = () => {
? '❌ This model is not supported!'
: '✅ This model is supported!'}
</p>
{repoData.tags.includes('gguf') ? (
{repoData.tags?.includes('gguf') ? (
<p>...But you can import it manually!</p>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const HuggingFaceSearchErrorModal = () => {
<p className="text-2xl font-bold">Error!</p>
<p className="text-gray-500">Fetch error</p>
</div>
<p>{fetchError.message}</p>
<p className="text-center">{fetchError.message}</p>
<Button
onClick={getRepoData}
className="w-full"
Expand Down

0 comments on commit 1bdf791

Please sign in to comment.