fix: import from HuggingFace with random string is causing app crash (#2214)
This commit is contained in:
parent
b70e7fb917
commit
1bdf791360
@ -20,7 +20,9 @@ export const useGetHFRepoData = () => {
|
|||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
setRepoData(data)
|
setRepoData(data)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setFetchError(err as Error)
|
setFetchError(
|
||||||
|
Error("The repo does not exist or you don't have access to it.")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export const HuggingFaceRepoDataLoadedModal = () => {
|
|||||||
? '❌ This model is not supported!'
|
? '❌ This model is not supported!'
|
||||||
: '✅ This model is supported!'}
|
: '✅ This model is supported!'}
|
||||||
</p>
|
</p>
|
||||||
{repoData.tags.includes('gguf') ? (
|
{repoData.tags?.includes('gguf') ? (
|
||||||
<p>...But you can import it manually!</p>
|
<p>...But you can import it manually!</p>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const HuggingFaceSearchErrorModal = () => {
|
|||||||
<p className="text-2xl font-bold">Error!</p>
|
<p className="text-2xl font-bold">Error!</p>
|
||||||
<p className="text-gray-500">Fetch error</p>
|
<p className="text-gray-500">Fetch error</p>
|
||||||
</div>
|
</div>
|
||||||
<p>{fetchError.message}</p>
|
<p className="text-center">{fetchError.message}</p>
|
||||||
<Button
|
<Button
|
||||||
onClick={getRepoData}
|
onClick={getRepoData}
|
||||||
className="w-full"
|
className="w-full"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user