Vokturz commited on
Commit
4d213de
·
1 Parent(s): c021aff

Change default model sort and limit results for first hf models request

Browse files
src/components/ModelSelector.tsx CHANGED
@@ -32,7 +32,7 @@ function ModelSelector() {
32
  isFetching,
33
  setIsFetching
34
  } = useModel()
35
- const [sortBy, setSortBy] = useState<SortOption>('downloads')
36
  const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc')
37
  const [showCustomInput, setShowCustomInput] = useState(false)
38
  const [customModelName, setCustomModelName] = useState('')
 
32
  isFetching,
33
  setIsFetching
34
  } = useModel()
35
+ const [sortBy, setSortBy] = useState<SortOption>('createdAt')
36
  const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('desc')
37
  const [showCustomInput, setShowCustomInput] = useState(false)
38
  const [customModelName, setCustomModelName] = useState('')
src/lib/huggingface.ts CHANGED
@@ -132,7 +132,7 @@ const getModelsByPipeline = async (
132
  ): Promise<ModelInfoResponse[]> => {
133
  // Second search with search=onnx
134
  const response1 = await fetch(
135
- `https://huggingface.co/api/models?filter=${pipelineTag}&search=onnx-community&sort=createdAt&limit=50`,
136
  {
137
  method: 'GET'
138
  }
 
132
  ): Promise<ModelInfoResponse[]> => {
133
  // Second search with search=onnx
134
  const response1 = await fetch(
135
+ `https://huggingface.co/api/models?filter=${pipelineTag}&search=onnx-community&sort=createdAt&limit=5`,
136
  {
137
  method: 'GET'
138
  }