forked from open-webui/open-webui
		
	Merge pull request #181 from ollama-webui/doc-update
feat: custom model chat styling updated
This commit is contained in:
		
						commit
						9c24c00fa5
					
				
					 3 changed files with 24 additions and 3 deletions
				
			
		|  | @ -317,7 +317,21 @@ | ||||||
| 		</div> | 		</div> | ||||||
| 		<div class=" mt-2 text-2xl text-gray-800 dark:text-gray-100 font-semibold"> | 		<div class=" mt-2 text-2xl text-gray-800 dark:text-gray-100 font-semibold"> | ||||||
| 			{#if selectedModelfile} | 			{#if selectedModelfile} | ||||||
| 				{selectedModelfile.desc} | 				<span class=" capitalize"> | ||||||
|  | 					{selectedModelfile.title} | ||||||
|  | 				</span> | ||||||
|  | 				<div class="mt-0.5 text-base font-normal text-gray-600 dark:text-gray-400"> | ||||||
|  | 					{selectedModelfile.desc} | ||||||
|  | 				</div> | ||||||
|  | 				{#if selectedModelfile.user} | ||||||
|  | 					<div class="mt-0.5 text-sm font-normal text-gray-500 dark:text-gray-500"> | ||||||
|  | 						By <a href="https://ollamahub.com/" | ||||||
|  | 							>{selectedModelfile.user.name | ||||||
|  | 								? selectedModelfile.user.name | ||||||
|  | 								: `@${selectedModelfile.user.username}`}</a | ||||||
|  | 						> | ||||||
|  | 					</div> | ||||||
|  | 				{/if} | ||||||
| 			{:else} | 			{:else} | ||||||
| 				How can I help you today? | 				How can I help you today? | ||||||
| 			{/if} | 			{/if} | ||||||
|  |  | ||||||
|  | @ -7,7 +7,7 @@ | ||||||
| 
 | 
 | ||||||
| 	const deleteModelHandler = async (tagName) => { | 	const deleteModelHandler = async (tagName) => { | ||||||
| 		let success = null; | 		let success = null; | ||||||
| 		const res = await fetch(`${OLLAMA_API_BASE_URL}/delete`, { | 		const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/delete`, { | ||||||
| 			method: 'DELETE', | 			method: 'DELETE', | ||||||
| 			headers: { | 			headers: { | ||||||
| 				'Content-Type': 'text/event-stream', | 				'Content-Type': 'text/event-stream', | ||||||
|  |  | ||||||
|  | @ -52,6 +52,8 @@ | ||||||
| 		num_ctx: '' | 		num_ctx: '' | ||||||
| 	}; | 	}; | ||||||
| 
 | 
 | ||||||
|  | 	let modelfileCreator = null; | ||||||
|  | 
 | ||||||
| 	$: tagName = title !== '' ? `${title.replace(/\s+/g, '-').toLowerCase()}:latest` : ''; | 	$: tagName = title !== '' ? `${title.replace(/\s+/g, '-').toLowerCase()}:latest` : ''; | ||||||
| 
 | 
 | ||||||
| 	$: if (!raw) { | 	$: if (!raw) { | ||||||
|  | @ -202,7 +204,8 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, ''); | ||||||
| 					desc: desc, | 					desc: desc, | ||||||
| 					content: content, | 					content: content, | ||||||
| 					suggestionPrompts: suggestions.filter((prompt) => prompt.content !== ''), | 					suggestionPrompts: suggestions.filter((prompt) => prompt.content !== ''), | ||||||
| 					categories: Object.keys(categories).filter((category) => categories[category]) | 					categories: Object.keys(categories).filter((category) => categories[category]), | ||||||
|  | 					user: modelfileCreator !== null ? modelfileCreator : undefined | ||||||
| 				}); | 				}); | ||||||
| 				await goto('/modelfiles'); | 				await goto('/modelfiles'); | ||||||
| 			} | 			} | ||||||
|  | @ -237,6 +240,10 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, ''); | ||||||
| 							} | 							} | ||||||
| 					  ]; | 					  ]; | ||||||
| 
 | 
 | ||||||
|  | 			modelfileCreator = { | ||||||
|  | 				username: modelfile.user.username, | ||||||
|  | 				name: modelfile.user.name | ||||||
|  | 			}; | ||||||
| 			for (const category of modelfile.categories) { | 			for (const category of modelfile.categories) { | ||||||
| 				categories[category.toLowerCase()] = true; | 				categories[category.toLowerCase()] = true; | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy Jaeryang Baek
						Timothy Jaeryang Baek