Skip to content

Commit

Permalink
fix: add lower case quantization support (#3293)
Browse files Browse the repository at this point in the history
  • Loading branch information
namchuai authored Aug 7, 2024
1 parent 2521e1d commit 3135ccc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
16 changes: 0 additions & 16 deletions web/screens/HubScreen2/components/ModelSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { toaster } from '@/containers/Toast'

import { useGetHFRepoData } from '@/hooks/useGetHFRepoData'

// import { setImportModelStageAtom } from '@/hooks/useImportModel'

import { MainViewState, mainViewStateAtom } from '@/helpers/atoms/App.atom'
import {
importHuggingFaceModelStageAtom,
Expand All @@ -28,7 +26,6 @@ const ModelSearchBar: React.FC<Props> = ({ onSearchChanged }) => {
const { getHfRepoData } = useGetHFRepoData()
const setMainViewState = useSetAtom(mainViewStateAtom)
const setSelectedSetting = useSetAtom(selectedSettingAtom)
// const setImportModelStage = useSetAtom(setImportModelStageAtom)

const setImportingHuggingFaceRepoData = useSetAtom(
importingHuggingFaceRepoDataAtom
Expand All @@ -37,10 +34,6 @@ const ModelSearchBar: React.FC<Props> = ({ onSearchChanged }) => {
importHuggingFaceModelStageAtom
)

// const onImportModelClick = useCallback(() => {
// setImportModelStage('SELECTING_MODEL')
// }, [setImportModelStage])

const debounced = useDebouncedCallback(async (searchText: string) => {
if (searchText.indexOf('/') === -1) {
// If we don't find / in the text, perform a local search
Expand Down Expand Up @@ -97,15 +90,6 @@ const ModelSearchBar: React.FC<Props> = ({ onSearchChanged }) => {
<FoldersIcon size={16} />
<span>My models</span>
</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>
)
}
Expand Down
6 changes: 5 additions & 1 deletion web/utils/huggingface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ export const fetchHuggingFaceRepoData = async (

AllQuantizations.forEach((quantization) => {
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
}
})
Expand Down

0 comments on commit 3135ccc

Please sign in to comment.