philschmid HF staff commited on
Commit
69ff6ba
1 Parent(s): 012b862
Files changed (1) hide show
  1. src/App.tsx +7 -1
src/App.tsx CHANGED
@@ -169,7 +169,13 @@ const App: React.FC = () => {
169
  options={
170
  data
171
  .flatMap((provider) => provider.models)
172
- .map((model) => ({ label: model.name, value: model.name })) || []
 
 
 
 
 
 
173
  }
174
  defaultValue={selectedModels}
175
  onValueChange={setSelectedModels}
 
169
  options={
170
  data
171
  .flatMap((provider) => provider.models)
172
+ .map((model) => ({ label: model.name, value: model.name }))
173
+ .reduce((acc: { label: string; value: string }[], curr: { label: string; value: string }) => {
174
+ if (!acc.find((m) => m.value === curr.value)) {
175
+ acc.push(curr)
176
+ }
177
+ return acc
178
+ }, []) || []
179
  }
180
  defaultValue={selectedModels}
181
  onValueChange={setSelectedModels}