Skip to content

Commit

Permalink
Bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Jan 14, 2024
1 parent 7cb0ee1 commit e06965e
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
.messages {
height: 442px;
overflow: auto;
font-size: 14px;
line-height: 20px;

.message {
margin-top: 15px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*ngIf="checkBoxText"
color="primary"
class="mt-md-0 mt-1 me-3"
[matTooltip]="checkBoxTooltip"
[(ngModel)]="checked"
(change)="filter()">
{{checkBoxText}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class FilterComponent implements OnInit {
@Input() type: string;
@Output() typeChange: EventEmitter<string> = new EventEmitter<string>();
@Input() checkBoxText: string = null;
@Input() checkBoxTooltip: string = null;
@Input() buttonText: string = null;
@Input() button2Text: string = null;
@Input() button3Text: string = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<button
mat-button
color="primary"
matTooltip="AI chatbot help"
matTooltip="AI chatbot"
class="ms-2 url-btn"
(click)="toggleChatbot()">
<div class="d-flex flex-nowrap align-items-center ps-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3 mat-dialog-title class="mb-3">
<mat-tab>

<ng-template mat-tab-label>
Model
Type
</ng-template>

<div class="mt-3 tab-content">
Expand Down Expand Up @@ -456,7 +456,7 @@ <h3 mat-dialog-title class="mb-3">

<p class="mb-1 fw-bold">Threshold</p>

<mat-form-field class="w-100 standalone-field" *ngIf="use_embeddings">
<mat-form-field class="w-100 standalone-field">
<span
matPrefix
matTooltip="Threshold for vectors when doing lookup into training data"
Expand All @@ -468,7 +468,7 @@ <h3 mat-dialog-title class="mb-3">
matInput
placeholder="Threshold ..."
type="number"
[disabled]="isLoading"
[disabled]="isLoading || !use_embeddings"
min="0.5"
max="1"
step="0.01"
Expand Down Expand Up @@ -524,7 +524,7 @@ <h3 mat-dialog-title class="mb-3">

<p class="mb-1 fw-bold">Vector model</p>

<mat-form-field class="w-100 standalone-field" *ngIf="use_embeddings">
<mat-form-field class="w-100 standalone-field">
<span
matPrefix
matTooltip="Vector model to vectorise training snippets"
Expand Down Expand Up @@ -564,7 +564,7 @@ <h3 mat-dialog-title class="mb-3">

<p class="mb-1 fw-bold">Max Context tokens</p>

<mat-form-field class="w-100 standalone-field me-2" *ngIf="use_embeddings">
<mat-form-field class="w-100 standalone-field me-2">
<span
matPrefix
matTooltip="Max context tokens, implying maximum size of context to send to OpenAI"
Expand All @@ -575,7 +575,7 @@ <h3 mat-dialog-title class="mb-3">
<input
matInput
placeholder="Max context tokens ..."
[disabled]="isLoading"
[disabled]="isLoading || !use_embeddings"
type="number"
min="1"
max="8000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export class MachineLearningEditTypeComponent implements OnInit {
ngOnInit() {

this.type = this.data?.type;
if (this.data?.model) {
this.model = {
id: this.data?.model,
};
}
this.max_context_tokens = this.data?.max_context_tokens ?? 1000;
this.max_request_tokens = this.data?.max_request_tokens ?? 250;
this.max_tokens = this.data?.max_tokens ?? 1000;
Expand Down Expand Up @@ -197,6 +202,9 @@ export class MachineLearningEditTypeComponent implements OnInit {
this.model = this.models.filter(x => x.id === 'gpt-3.5-turbo')[0];
}
}
if (this.model.id.startsWith('gpt')) {
this.cached = false;
}

if (this.data?.vector_model) {
this.vector_model = this.models.filter(x => x.id === this.data.vector_model)[0];
Expand Down Expand Up @@ -235,6 +243,7 @@ export class MachineLearningEditTypeComponent implements OnInit {

if (this.model?.id?.startsWith('gpt-')) {
this.prefix = '';
this.cached = false;
} else if (this.use_embeddings) {
this.prefix = 'Answer the following QUESTION while using the information in the following CONTEXT. If you cannot answer the question using the specified CONTEXT then answer "I don\'t know the answer, try to be more specific.".\r\n\r\nQUESTION: [QUESTION]\r\n\r\nCONTEXT: [CONTEXT]\r\n\r\nANSWER:';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ <h3 mat-dialog-title class="mb-0">

<button
mat-flat-button
color="primary"
type="submit">
Save
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class MachineLearningEditQuestionnaireComponent {

name: string = '';
type: string = 'single-shot';
action: string = 'sendgrid-subscribe';
action: string = '';
types: string[] = [
'single-shot'
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ <h3 class="mb-2 fw-bold">Machine Learning training data</h3>
(buttonClick)="create()"
[(type)]="type"
checkBoxText="VSS"
checkBoxTooltip="Use vector semantic search to search for snippets (ONLY works if you have vectorized your type)"
[types]="types">
</app-filter>

Expand Down
10 changes: 5 additions & 5 deletions frontend/src/app/helpers/common-regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export const CommonRegEx: { [key: string]: RegExp } = {
phone: /^[0-9 ]*$/,
name: /^[a-z0-9]{2,20}$/,
subject: /^.{4,1000}$/,
appNames: /^[a-z0-9_.-]+$/,
appNamesWithDot: /^[a-z0-9_.-]+$/,
appNamesWithUppercaseDot: /^[a-zA-Z0-9_.-]+$/,
appNames: /^[a-z0-9_.\-]+$/,
appNamesWithDot: /^[a-z0-9_.\-]+$/,
appNamesWithUppercaseDot: /^[a-zA-Z0-9_.\-]+$/,
appNameWithUppercase: /^[a-zA-Z0-9_]+$/,
appNameWithUppercaseHyphen: /^[a-zA-Z0-9_-]+$/,
appNameWithUppercaseHyphen: /^[a-zA-Z0-9_\-]+$/,
domain: /(^https?:\/\/)([\w\-])+\.{1}([a-zA-Z]{2,63})([\/\w-]*)*\/?\??([^#\n\r]*)?#?([^\n\r]*)/,
backend: /^https?:\/\/([\w\-.])+(:[0-9]*)?(\.\w+)?$/,
email: /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/,
password: /^.{12,}$/,
recaptcha: /^([a-zA-Z-_0-9]{20,100})$/,
recaptcha: /^([a-zA-Z\-_0-9]{20,100})$/,
};
6 changes: 6 additions & 0 deletions frontend/src/assets/styles/_variables/fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
src: url("../../fonts/Inter-Medium.ttf");
}

@font-face {
font-family: "inter-regular";
src: url("../../fonts/Inter-Bold.ttf");
font-weight: bold;
}

$ainiro_font: "inter-regular";
$ainiro_font_medium: "inter-medium";

0 comments on commit e06965e

Please sign in to comment.