Use openai compatible as vendor
This commit is contained in:
@@ -85,7 +85,7 @@ const convertRecordedBlobToWav = async (blob: Blob): Promise<File> => {
|
||||
export const ASRLibraryPage: React.FC = () => {
|
||||
const [models, setModels] = useState<ASRModel[]>([]);
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
const [vendorFilter, setVendorFilter] = useState<string>('all');
|
||||
const [vendorFilter, setVendorFilter] = useState<string>('OpenAI Compatible');
|
||||
const [langFilter, setLangFilter] = useState<string>('all');
|
||||
const [isAddModalOpen, setIsAddModalOpen] = useState(false);
|
||||
const [editingModel, setEditingModel] = useState<ASRModel | null>(null);
|
||||
@@ -111,7 +111,7 @@ export const ASRLibraryPage: React.FC = () => {
|
||||
const filteredModels = models.filter((m) => {
|
||||
const q = searchTerm.toLowerCase();
|
||||
const matchesSearch = m.name.toLowerCase().includes(q) || (m.modelName || '').toLowerCase().includes(q);
|
||||
const matchesVendor = vendorFilter === 'all' || m.vendor === vendorFilter;
|
||||
const matchesVendor = m.vendor === vendorFilter;
|
||||
const matchesLang = langFilter === 'all' || m.language === langFilter || (langFilter !== 'all' && m.language === 'Multi-lingual');
|
||||
return matchesSearch && matchesVendor && matchesLang;
|
||||
});
|
||||
@@ -134,8 +134,6 @@ export const ASRLibraryPage: React.FC = () => {
|
||||
setModels((prev) => prev.filter((m) => m.id !== id));
|
||||
};
|
||||
|
||||
const vendorOptions = Array.from(new Set(models.map((m) => m.vendor).filter(Boolean)));
|
||||
|
||||
return (
|
||||
<div className="space-y-6 animate-in fade-in py-4 pb-10">
|
||||
<div className="flex items-center justify-between">
|
||||
@@ -162,10 +160,7 @@ export const ASRLibraryPage: React.FC = () => {
|
||||
value={vendorFilter}
|
||||
onChange={(e) => setVendorFilter(e.target.value)}
|
||||
>
|
||||
<option value="all">所有厂商</option>
|
||||
{vendorOptions.map((vendor) => (
|
||||
<option key={vendor} value={vendor}>{vendor}</option>
|
||||
))}
|
||||
<option value="OpenAI Compatible">OpenAI Compatible</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
@@ -371,7 +366,6 @@ const ASRModelModal: React.FC<{
|
||||
onChange={(e) => setVendor(e.target.value)}
|
||||
>
|
||||
<option value="OpenAI Compatible">OpenAI Compatible</option>
|
||||
<option value="SiliconFlow">SiliconFlow</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
|
||||
Reference in New Issue
Block a user