forked from open-webui/open-webui
		
	fix: openai issue
This commit is contained in:
		
							parent
							
								
									f051b366e3
								
							
						
					
					
						commit
						7bc0c09b25
					
				
					 5 changed files with 108 additions and 21 deletions
				
			
		|  | @ -6,7 +6,7 @@ | |||
| 	import { goto } from '$app/navigation'; | ||||
| 	import { page } from '$app/stores'; | ||||
| 
 | ||||
| 	import { models, modelfiles, user, settings, chats, chatId } from '$lib/stores'; | ||||
| 	import { models, modelfiles, user, settings, chats, chatId, config } from '$lib/stores'; | ||||
| 	import { OLLAMA_API_BASE_URL } from '$lib/constants'; | ||||
| 
 | ||||
| 	import { generateChatCompletion, generateTitle } from '$lib/apis/ollama'; | ||||
|  | @ -90,9 +90,18 @@ | |||
| 			messages: {}, | ||||
| 			currentId: null | ||||
| 		}; | ||||
| 		selectedModels = $page.url.searchParams.get('models') | ||||
| 			? $page.url.searchParams.get('models')?.split(',') | ||||
| 			: $settings.models ?? ['']; | ||||
| 
 | ||||
| 		console.log($config); | ||||
| 
 | ||||
| 		if ($page.url.searchParams.get('models')) { | ||||
| 			selectedModels = $page.url.searchParams.get('models')?.split(','); | ||||
| 		} else if ($settings?.models) { | ||||
| 			selectedModels = $settings?.models; | ||||
| 		} else if ($config?.default_models) { | ||||
| 			selectedModels = $config?.default_models.split(','); | ||||
| 		} else { | ||||
| 			selectedModels = ['']; | ||||
| 		} | ||||
| 
 | ||||
| 		let _settings = JSON.parse(localStorage.getItem('settings') ?? '{}'); | ||||
| 		settings.set({ | ||||
|  | @ -383,13 +392,13 @@ | |||
| 										  } | ||||
| 										: { content: message.content }) | ||||
| 								})), | ||||
| 							seed: $settings.options.seed ?? undefined, | ||||
| 							stop: $settings.options.stop ?? undefined, | ||||
| 							temperature: $settings.options.temperature ?? undefined, | ||||
| 							top_p: $settings.options.top_p ?? undefined, | ||||
| 							num_ctx: $settings.options.num_ctx ?? undefined, | ||||
| 							frequency_penalty: $settings.options.repeat_penalty ?? undefined, | ||||
| 							max_tokens: $settings.options.num_predict ?? undefined | ||||
| 							seed: $settings?.options?.seed ?? undefined, | ||||
| 							stop: $settings?.options?.stop ?? undefined, | ||||
| 							temperature: $settings?.options?.temperature ?? undefined, | ||||
| 							top_p: $settings?.options?.top_p ?? undefined, | ||||
| 							num_ctx: $settings?.options?.num_ctx ?? undefined, | ||||
| 							frequency_penalty: $settings?.options?.repeat_penalty ?? undefined, | ||||
| 							max_tokens: $settings?.options?.num_predict ?? undefined | ||||
| 						}) | ||||
| 					} | ||||
| 				).catch((err) => { | ||||
|  |  | |||
|  | @ -409,13 +409,13 @@ | |||
| 										  } | ||||
| 										: { content: message.content }) | ||||
| 								})), | ||||
| 							seed: $settings.options.seed ?? undefined, | ||||
| 							stop: $settings.options.stop ?? undefined, | ||||
| 							temperature: $settings.options.temperature ?? undefined, | ||||
| 							top_p: $settings.options.top_p ?? undefined, | ||||
| 							num_ctx: $settings.options.num_ctx ?? undefined, | ||||
| 							frequency_penalty: $settings.options.repeat_penalty ?? undefined, | ||||
| 							max_tokens: $settings.options.num_predict ?? undefined | ||||
| 							seed: $settings?.options?.seed ?? undefined, | ||||
| 							stop: $settings?.options?.stop ?? undefined, | ||||
| 							temperature: $settings?.options?.temperature ?? undefined, | ||||
| 							top_p: $settings?.options?.top_p ?? undefined, | ||||
| 							num_ctx: $settings?.options?.num_ctx ?? undefined, | ||||
| 							frequency_penalty: $settings?.options?.repeat_penalty ?? undefined, | ||||
| 							max_tokens: $settings?.options?.num_predict ?? undefined | ||||
| 						}) | ||||
| 					} | ||||
| 				).catch((err) => { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek