fix: add lower case quantization support (#3293)
This commit is contained in:
parent
2521e1db51
commit
3135ccc27e
@ -10,8 +10,6 @@ import { toaster } from '@/containers/Toast'
|
|||||||
|
|
||||||
import { useGetHFRepoData } from '@/hooks/useGetHFRepoData'
|
import { useGetHFRepoData } from '@/hooks/useGetHFRepoData'
|
||||||
|
|
||||||
// import { setImportModelStageAtom } from '@/hooks/useImportModel'
|
|
||||||
|
|
||||||
import { MainViewState, mainViewStateAtom } from '@/helpers/atoms/App.atom'
|
import { MainViewState, mainViewStateAtom } from '@/helpers/atoms/App.atom'
|
||||||
import {
|
import {
|
||||||
importHuggingFaceModelStageAtom,
|
importHuggingFaceModelStageAtom,
|
||||||
@ -28,7 +26,6 @@ const ModelSearchBar: React.FC<Props> = ({ onSearchChanged }) => {
|
|||||||
const { getHfRepoData } = useGetHFRepoData()
|
const { getHfRepoData } = useGetHFRepoData()
|
||||||
const setMainViewState = useSetAtom(mainViewStateAtom)
|
const setMainViewState = useSetAtom(mainViewStateAtom)
|
||||||
const setSelectedSetting = useSetAtom(selectedSettingAtom)
|
const setSelectedSetting = useSetAtom(selectedSettingAtom)
|
||||||
// const setImportModelStage = useSetAtom(setImportModelStageAtom)
|
|
||||||
|
|
||||||
const setImportingHuggingFaceRepoData = useSetAtom(
|
const setImportingHuggingFaceRepoData = useSetAtom(
|
||||||
importingHuggingFaceRepoDataAtom
|
importingHuggingFaceRepoDataAtom
|
||||||
@ -37,10 +34,6 @@ const ModelSearchBar: React.FC<Props> = ({ onSearchChanged }) => {
|
|||||||
importHuggingFaceModelStageAtom
|
importHuggingFaceModelStageAtom
|
||||||
)
|
)
|
||||||
|
|
||||||
// const onImportModelClick = useCallback(() => {
|
|
||||||
// setImportModelStage('SELECTING_MODEL')
|
|
||||||
// }, [setImportModelStage])
|
|
||||||
|
|
||||||
const debounced = useDebouncedCallback(async (searchText: string) => {
|
const debounced = useDebouncedCallback(async (searchText: string) => {
|
||||||
if (searchText.indexOf('/') === -1) {
|
if (searchText.indexOf('/') === -1) {
|
||||||
// If we don't find / in the text, perform a local search
|
// If we don't find / in the text, perform a local search
|
||||||
@ -97,15 +90,6 @@ const ModelSearchBar: React.FC<Props> = ({ onSearchChanged }) => {
|
|||||||
<FoldersIcon size={16} />
|
<FoldersIcon size={16} />
|
||||||
<span>My models</span>
|
<span>My models</span>
|
||||||
</Button>
|
</Button>
|
||||||
{/* Temporary hidden button import model */}
|
|
||||||
{/* <Button
|
|
||||||
className="flex gap-2 bg-[hsla(var(--app-bg))] text-[hsla(var(--text-primary))]"
|
|
||||||
theme="ghost"
|
|
||||||
onClick={onImportModelClick}
|
|
||||||
>
|
|
||||||
<ImportIcon size={16} />
|
|
||||||
<span>Import model</span>
|
|
||||||
</Button> */}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -305,7 +305,11 @@ export const fetchHuggingFaceRepoData = async (
|
|||||||
|
|
||||||
AllQuantizations.forEach((quantization) => {
|
AllQuantizations.forEach((quantization) => {
|
||||||
data.siblings.forEach((sibling) => {
|
data.siblings.forEach((sibling) => {
|
||||||
if (!sibling.quantization && sibling.rfilename.includes(quantization)) {
|
if (
|
||||||
|
!sibling.quantization &&
|
||||||
|
(sibling.rfilename.includes(quantization) ||
|
||||||
|
sibling.rfilename.includes(quantization.toLowerCase()))
|
||||||
|
) {
|
||||||
sibling.quantization = quantization
|
sibling.quantization = quantization
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user