forked from open-webui/open-webui
		
	feat: allow custom model name
This commit is contained in:
		
							parent
							
								
									25d09363df
								
							
						
					
					
						commit
						b1d204fdd4
					
				
					 1 changed files with 33 additions and 13 deletions
				
			
		|  | @ -332,6 +332,24 @@ | |||
| 				<div class=" mb-2.5 text-sm font-medium">{$i18n.t('Set Default Model')}</div> | ||||
| 				<div class="flex w-full"> | ||||
| 					<div class="flex-1 mr-2"> | ||||
| 						{#if imageGenerationEngine === 'openai' && !OPENAI_API_BASE_URL.includes('https://api.openai.com')} | ||||
| 							<div class="flex w-full"> | ||||
| 								<div class="flex-1"> | ||||
| 									<input | ||||
| 										list="model-list" | ||||
| 										class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none" | ||||
| 										bind:value={selectedModel} | ||||
| 										placeholder="Select a model" | ||||
| 									/> | ||||
| 
 | ||||
| 									<datalist id="model-list"> | ||||
| 										{#each models ?? [] as model} | ||||
| 											<option value={model.id}>{model.name}</option> | ||||
| 										{/each} | ||||
| 									</datalist> | ||||
| 								</div> | ||||
| 							</div> | ||||
| 						{:else} | ||||
| 							<select | ||||
| 								class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none" | ||||
| 								bind:value={selectedModel} | ||||
|  | @ -342,9 +360,11 @@ | |||
| 									<option value="" disabled selected>{$i18n.t('Select a model')}</option> | ||||
| 								{/if} | ||||
| 								{#each models ?? [] as model} | ||||
| 								<option value={model.id} class="bg-gray-100 dark:bg-gray-700">{model.name}</option> | ||||
| 									<option value={model.id} class="bg-gray-100 dark:bg-gray-700">{model.name}</option | ||||
| 									> | ||||
| 								{/each} | ||||
| 							</select> | ||||
| 						{/if} | ||||
| 					</div> | ||||
| 				</div> | ||||
| 			</div> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek