Update KBTrain.html
Browse files- KBTrain.html +154 -132
KBTrain.html
CHANGED
|
@@ -1,142 +1,164 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
-
|
| 4 |
-
<title>
|
| 5 |
<style>
|
| 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 |
</style>
|
|
|
|
| 99 |
<script type="text/javascript">
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
} else {
|
| 118 |
-
|
| 119 |
}
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
<form action="/file_upload" method="post" enctype="multipart/form-data">
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
</form>
|
| 139 |
-
</div>
|
| 140 |
</div>
|
| 141 |
-
|
| 142 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>File Upload Form</title>
|
| 5 |
<style>
|
| 6 |
+
body {
|
| 7 |
+
background-color: #f2f2f2;
|
| 8 |
+
font-family: Arial, Helvetica, sans-serif;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
.container {
|
| 12 |
+
display: flex;
|
| 13 |
+
flex-direction: column;
|
| 14 |
+
height: 600px;
|
| 15 |
+
max-width: 700px;
|
| 16 |
+
margin: 0 auto;
|
| 17 |
+
background-color: #fff;
|
| 18 |
+
border-radius: 10px;
|
| 19 |
+
box-shadow: 0px 5px 10px rgba(0,0,0,0.1);
|
| 20 |
+
overflow: hidden;
|
| 21 |
+
}
|
| 22 |
+
.header {
|
| 23 |
+
display: flex;
|
| 24 |
+
align-items: center;
|
| 25 |
+
justify-content: center;
|
| 26 |
+
height: 60px;
|
| 27 |
+
background-color:#0f3cc9 ;
|
| 28 |
+
/* #075E54 */
|
| 29 |
+
color: #fff;
|
| 30 |
+
font-weight: bold;
|
| 31 |
+
font-size: 20px;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
form {
|
| 35 |
+
background-color: #fff;
|
| 36 |
+
border-radius: 5px;
|
| 37 |
+
padding: 20px;
|
| 38 |
+
width: 500px;
|
| 39 |
+
margin: 0 auto;
|
| 40 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
label {
|
| 44 |
+
display: block;
|
| 45 |
+
font-size: 18px;
|
| 46 |
+
font-weight: bold;
|
| 47 |
+
margin-bottom: 10px;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
input[type=file] {
|
| 51 |
+
border: none;
|
| 52 |
+
display: block;
|
| 53 |
+
font-size: 16px;
|
| 54 |
+
margin-bottom: 20px;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
input[type=url] {
|
| 58 |
+
border: 4px;
|
| 59 |
+
border-color: #0f3cc9;
|
| 60 |
+
width:500px;
|
| 61 |
+
box-shadow: 3px 5px 10px rgba(200,0,0,0.1);
|
| 62 |
+
display: block;
|
| 63 |
+
font-size: 16px;
|
| 64 |
+
margin-bottom: 20px;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
input[type=submit] {
|
| 68 |
+
background-color: #4CAF50;
|
| 69 |
+
border: none;
|
| 70 |
+
color: #fff;
|
| 71 |
+
cursor: pointer;
|
| 72 |
+
font-size: 18px;
|
| 73 |
+
padding: 10px 20px;
|
| 74 |
+
border-radius: 5px;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
input[type=submit]:hover {
|
| 78 |
+
background-color: #3e8e41;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.logoClass
|
| 82 |
+
{
|
| 83 |
+
width: 50px;
|
| 84 |
+
height: 40px;
|
| 85 |
+
align-self: center;
|
| 86 |
+
margin-right: 10px;
|
| 87 |
+
gap: 20px 20px;
|
| 88 |
+
background-repeat: no-repeat;
|
| 89 |
+
background-size: cover;
|
| 90 |
+
/* background-image: url({{url_for('static',filename='Jio-Logo.png')}}); */
|
| 91 |
+
}
|
| 92 |
+
.upload-form
|
| 93 |
+
{
|
| 94 |
+
flex-grow: 1;
|
| 95 |
+
padding: 20px;
|
| 96 |
+
overflow-y: auto;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
select
|
| 100 |
+
{
|
| 101 |
+
font-size: 30px;
|
| 102 |
+
}
|
| 103 |
</style>
|
| 104 |
+
|
| 105 |
<script type="text/javascript">
|
| 106 |
+
|
| 107 |
+
window.onload = function() {
|
| 108 |
+
|
| 109 |
+
// var uploadField = document.getElementById("file");
|
| 110 |
+
|
| 111 |
+
// uploadField.onchange = function() {
|
| 112 |
+
// for (file in this.files)
|
| 113 |
+
// {
|
| 114 |
+
|
| 115 |
+
// }
|
| 116 |
+
// if(this.files[0].size > 2200000){
|
| 117 |
+
// alert("Max Allowed PDF Size is 2 MB");
|
| 118 |
+
// this.value = "";
|
| 119 |
+
// };
|
| 120 |
+
};
|
| 121 |
+
|
| 122 |
+
let output = document.getElementById("output");
|
| 123 |
+
function validateFileInput() {
|
| 124 |
+
let files = $("#fileInput")[0].files.length;
|
| 125 |
+
if (files != 0) {
|
| 126 |
+
output.innerHTML += "File is selected! <br/>";
|
| 127 |
} else {
|
| 128 |
+
output.innerHTML += "Please, select a file!<br>";
|
| 129 |
}
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
</script>
|
| 135 |
+
|
| 136 |
+
</head>
|
| 137 |
+
<body>
|
| 138 |
+
<div class="container">
|
| 139 |
+
<div class="header">
|
| 140 |
+
<div><img class="logoClass" src="../static/Jio-Logo.png" alt="Jio Logo"/> </div>
|
| 141 |
+
<div>JioSearch - KB Upload</div>
|
| 142 |
+
</div>
|
| 143 |
+
<div class="upload-form">
|
| 144 |
<form action="/file_upload" method="post" enctype="multipart/form-data">
|
| 145 |
+
<label for="file">Choose KnowledgeBase PDF files to upload:</label>
|
| 146 |
+
<input type="file" name="files[]" id="file" multiple="true" accept=".pdf"><br><br>
|
| 147 |
+
<label for="weburl">Add your KnowledgeBase URL:</label>
|
| 148 |
+
<input type="url" id="weburl" name="weburl">
|
| 149 |
+
<label for="embeddingModel">Select Embedding Model</label>
|
| 150 |
+
<select name="embeddingModel" id="embeddingModel">
|
| 151 |
+
<option value="1">All-MiniLM-L6-v2 Embedding</option>
|
| 152 |
+
<option value="2">Instructor Embedding</option>
|
| 153 |
+
<option value="3">Flag Embedding</option>
|
| 154 |
+
<option value="4">Open AI - text-embedding-ada-002</option>
|
| 155 |
+
</select>
|
| 156 |
+
<br><br>
|
| 157 |
+
<input type="submit" value="Upload" >
|
| 158 |
</form>
|
|
|
|
| 159 |
</div>
|
| 160 |
+
|
| 161 |
+
</div>
|
| 162 |
+
|
| 163 |
+
</body>
|
| 164 |
+
</html>
|