Skip to content

Commit

Permalink
fix: frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed May 16, 2024
1 parent 9652ca4 commit 4cc02c4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
14 changes: 13 additions & 1 deletion backend/src/main/resources/application-ollama.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ spring.ai.embedding.transformer.enabled=true
document-token-limit=150
embedding-token-limit=500
spring.liquibase.change-log=classpath:/dbchangelog/db.changelog-master-ollama.xml

# sql creation
# sql model for free production use with clause that fine tuned values have to be published.
#spring.ai.ollama.chat.model=sqlcoder:70b-alpha-q6_K

# document processing
# falcon model config free production use
#spring.ai.ollama.chat.model=falcon:40b
# beluga model config only for non production/commercial use
spring.ai.ollama.chat.model=stable-beluga:13b

# function calling
#spring.ai.ollama.chat.model=mixtral:8x7b-text-v0.1-q6_K
#spring.ai.ollama.chat.model=llava:34b-v1.6-q6_K

# image processing
#spring.ai.ollama.chat.model=llava:34b-v1.6-q6_K
#spring.ai.ollama.chat.options.num-thread=8
#spring.ai.ollama.chat.options.keep_alive=1s

#spring.ai.ollama.embedding.options.model=mxbai-embed-large:335m #test with Spring AI 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@
}
</form>
<div class="horizontal-container">
<button mat-button (click)="cancel()" i18n="@@cancel">Cancel</button>
<button
<button class="my-button"
mat-flat-button
color="primary"
[disabled]="uploading"
[disabled]="uploading || imageForm.invalid"
(click)="upload()"
i18n="@@upload"
>
Expand All @@ -88,7 +87,7 @@
<mat-label i18n="@@imageQuery">Image query</mat-label>
<input matInput placeholder="query" [formControl]="queryControl">
</mat-form-field>
<button mat-flat-button color="primary" (click)="query()" [disabled]="queryControl.invalid || this.queryControl.untouched" i18n="@@query">Query</button>
<button mat-flat-button color="primary" class="my-button" (click)="query()" [disabled]="queryControl.invalid || this.queryControl.untouched" i18n="@@query">Query</button>
<div class="images">
@for(myresult of results; track myresult.answer) {
<div class="horizontal-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@
margin-top: 20px;
overflow-y: scroll;
height: calc(100vh - (36px + 21px + 64px));
}

.my-button {
margin-left: 10px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, DestroyRef, inject } from '@angular/core';
import { Component, DestroyRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import {MatInputModule} from '@angular/material/input';
Expand All @@ -34,7 +34,7 @@ export class ImageQueryComponent {
//'What do you see in the image? Describe the background. Describe the colors.'
protected imageForm = new FormGroup({
file: new FormControl<File | null>(null, Validators.required),
prompt: new FormControl<string>('What do you see in the image? Describe the background. Describe the colors.', Validators.minLength(3))
prompt: new FormControl<string>('What do you see in the image? Describe the background. Describe the colors.', Validators.compose([Validators.required, Validators.minLength(3)]))
});
protected queryControl = new FormControl<string>('', Validators.compose([Validators.required, Validators.minLength(3)]));
protected uploading = false;
Expand Down Expand Up @@ -128,8 +128,4 @@ export class ImageQueryComponent {
protected logout(): void {
console.log('logout');
}

protected cancel(): void {
this.router.navigate(['/']);
}
}

0 comments on commit 4cc02c4

Please sign in to comment.