File size: 4,524 Bytes
622ba6e
 
d969a8f
2449e67
d969a8f
 
 
 
 
622ba6e
d969a8f
 
 
71b382d
d969a8f
 
 
 
 
 
 
622ba6e
d969a8f
 
 
 
 
 
 
 
 
 
 
622ba6e
d969a8f
 
 
 
 
 
 
 
622ba6e
d969a8f
 
 
 
 
 
622ba6e
d969a8f
 
 
 
 
 
622ba6e
d969a8f
 
 
 
 
 
 
 
 
622ba6e
d969a8f
 
 
 
 
 
 
 
 
ee216ab
d969a8f
 
 
 
 
 
 
 
 
 
 
 
2449e67
d969a8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622ba6e
d969a8f
 
 
 
622ba6e
d969a8f
2449e67
 
d969a8f
 
 
 
 
 
 
 
 
750ef0a
 
 
 
 
 
 
 
d969a8f
 
 
622ba6e
d969a8f
622ba6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    <!DOCTYPE html>
    <html>
      <head>
        <title>KB Upload Form</title>
        <style>
          body {
            background-color: #f2f2f2;
            font-family: Arial, Helvetica, sans-serif;
          }

          .container {
            display: flex;
            flex-direction: column;
            height: 600px;
            max-width: 700px;
            margin: 0 auto;
            background-color: #fff;
            border-radius: 10px;
            box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.1);
            overflow: hidden;
          }

          .header {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 60px;
            background-color: #0f3cc9;
            /* #075E54 */
            color: #fff;
            font-weight: bold;
            font-size: 20px;
          }

          form {
            background-color: #fff;
            border-radius: 5px;
            padding: 20px;
            width: 500px;
            margin: 0 auto;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
          }

          label {
            display: block;
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 10px;
          }

          input[type=file] {
            border: none;
            display: block;
            font-size: 16px;
            margin-bottom: 20px;
          }

          input[type=url] {
            border: 4px;
            border-color: #0f3cc9;
            width: 500px;
            box-shadow: 3px 5px 10px rgba(200, 0, 0, 0.1);
            display: block;
            font-size: 16px;
            margin-bottom: 20px;
          }

          input[type=submit] {
            background-color: #4CAF50;
            border: none;
            color: #fff;
            cursor: pointer;
            font-size: 18px;
            padding: 10px 20px;
            border-radius: 5px;
          }

          input[type=submit]:hover {
            background-color: #3e8e41;
          }

          .logoClass {
            width: 50px;
            height: 40px;
            align-self: center;
            margin-right: 10px;
            gap: 20px 20px;
            background-repeat: no-repeat;
            background-size: cover;
            
          }

          .upload-form {
            flex-grow: 1;
            padding: 20px;
            overflow-y: auto;
          }
        </style>
        <script type="text/javascript">
          window.onload = function() {
            // var uploadField = document.getElementById("file");
            // uploadField.onchange = function() {
            //  for (file in this.files)
            //  {
            //  }
            //  if(this.files[0].size > 2200000){
            //     alert("Max Allowed PDF Size is 2 MB");
            //     this.value = "";
            // };
          };
          let output = document.getElementById("output");

          function validateFileInput() {
            let files = $("#fileInput")[0].files.length;
            if (files != 0) {
              output.innerHTML += "File is selected!  < br / > ";
            } else {
              output.innerHTML += "Please, select a file! < br > ";
            }
          }
        </script>
      </head>
      <body>
        <div class="container">
          <div class="header">
            
            <div>AI Assist Powered by J-GPT</div>
          </div>
          <div class="upload-form">
            <form action="/file_upload" method="post" enctype="multipart/form-data">
              <label for="file">Choose KnowledgeBase PDF files to upload:</label>
              <input type="file" name="files[]" id="file" multiple="true" accept=".pdf">
              <br>
              <br>
              <label for="weburl">Add your KnowledgeBase URL:</label>
              <input type="url" id="weburl" name="weburl">
              <label for="embeddingModelID">Select Embedding Model for Semantic Search</label>
              <select name="embeddingModelID" id="embeddingModelID">
                    <option value="1">All-MiniLM-L6-v2 Embedding</option>
                    <option value="2">Instructor Embedding</option>
                    <option value="3">Flag Embedding</option>
                    <option value="4">Open AI - text-embedding-ada-002</option>
              </select>
              <br><br>
              <input type="submit" value="Upload">
            </form>
          </div>
        </div>
      </body>
    </html>