Spaces:
Runtime error
Runtime error
Update KBTrain.html
Browse files- KBTrain.html +130 -103
KBTrain.html
CHANGED
|
@@ -1,117 +1,144 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 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 |
-
|
| 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 |
-
padding: 10px 20px;
|
| 64 |
-
border-radius: 5px;
|
| 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 |
<div class="container">
|
| 102 |
-
|
| 103 |
-
<div
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
</div>
|
| 106 |
-
|
| 107 |
-
<form action="/file_upload" method="post" enctype="multipart/form-data">
|
| 108 |
-
<label for="file">Choose KnowledgeBase PDF files to upload:</label>
|
| 109 |
-
<input type="file" name="files[]" id="file" multiple="true" accept=".pdf"><br><br>
|
| 110 |
-
<label for="weburl">Add your KnowledgeBase URL:</label>
|
| 111 |
-
<input type="url" id="weburl" name="weburl">
|
| 112 |
-
<input type="submit" value="Upload" >
|
| 113 |
-
</form>
|
| 114 |
-
</div>
|
| 115 |
-
</div>
|
| 116 |
-
</body>
|
| 117 |
</html>
|
|
|
|
| 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: 400px;
|
| 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 |
|
| 23 |
+
.header {
|
| 24 |
+
display: flex;
|
| 25 |
+
align-items: center;
|
| 26 |
+
justify-content: center;
|
| 27 |
+
height: 60px;
|
| 28 |
+
background-color: #0f3cc9;
|
| 29 |
+
/* #075E54 */
|
| 30 |
+
color: #fff;
|
| 31 |
+
font-weight: bold;
|
| 32 |
+
font-size: 20px;
|
| 33 |
+
}
|
| 34 |
|
| 35 |
+
form {
|
| 36 |
+
background-color: #fff;
|
| 37 |
+
border-radius: 5px;
|
| 38 |
+
padding: 20px;
|
| 39 |
+
width: 500px;
|
| 40 |
+
margin: 0 auto;
|
| 41 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
| 42 |
+
}
|
| 43 |
|
| 44 |
+
label {
|
| 45 |
+
display: block;
|
| 46 |
+
font-size: 18px;
|
| 47 |
+
font-weight: bold;
|
| 48 |
+
margin-bottom: 10px;
|
| 49 |
+
}
|
| 50 |
|
| 51 |
+
input[type=file] {
|
| 52 |
+
border: none;
|
| 53 |
+
display: block;
|
| 54 |
+
font-size: 16px;
|
| 55 |
+
margin-bottom: 20px;
|
| 56 |
+
}
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
input[type=url] {
|
| 59 |
+
border: 4px;
|
| 60 |
+
border-color: #0f3cc9;
|
| 61 |
+
width: 500px;
|
| 62 |
+
box-shadow: 3px 5px 10px rgba(200, 0, 0, 0.1);
|
| 63 |
+
display: block;
|
| 64 |
+
font-size: 16px;
|
| 65 |
+
margin-bottom: 20px;
|
| 66 |
+
}
|
| 67 |
|
| 68 |
+
input[type=submit] {
|
| 69 |
+
background-color: #4CAF50;
|
| 70 |
+
border: none;
|
| 71 |
+
color: #fff;
|
| 72 |
+
cursor: pointer;
|
| 73 |
+
font-size: 18px;
|
| 74 |
+
padding: 10px 20px;
|
| 75 |
+
border-radius: 5px;
|
| 76 |
+
}
|
| 77 |
|
| 78 |
+
input[type=submit]:hover {
|
| 79 |
+
background-color: #3e8e41;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.logoClass {
|
| 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 |
+
|
| 93 |
+
.upload-form {
|
| 94 |
+
flex-grow: 1;
|
| 95 |
+
padding: 20px;
|
| 96 |
+
overflow-y: auto;
|
| 97 |
+
}
|
| 98 |
+
</style>
|
| 99 |
+
<script type="text/javascript">
|
| 100 |
+
window.onload = function() {
|
| 101 |
+
// var uploadField = document.getElementById("file");
|
| 102 |
+
// uploadField.onchange = function() {
|
| 103 |
+
// for (file in this.files)
|
| 104 |
+
// {
|
| 105 |
+
// }
|
| 106 |
+
// if(this.files[0].size > 2200000){
|
| 107 |
+
// alert("Max Allowed PDF Size is 2 MB");
|
| 108 |
+
// this.value = "";
|
| 109 |
+
// };
|
| 110 |
+
};
|
| 111 |
+
let output = document.getElementById("output");
|
| 112 |
+
|
| 113 |
+
function validateFileInput() {
|
| 114 |
+
let files = $("#fileInput")[0].files.length;
|
| 115 |
+
if (files != 0) {
|
| 116 |
+
output.innerHTML += "File is selected! < br / > ";
|
| 117 |
+
} else {
|
| 118 |
+
output.innerHTML += "Please, select a file! < br > ";
|
| 119 |
}
|
| 120 |
+
}
|
| 121 |
+
</script>
|
| 122 |
+
</head>
|
| 123 |
+
<body>
|
| 124 |
<div class="container">
|
| 125 |
+
<div class="header">
|
| 126 |
+
<div>
|
| 127 |
+
<img class="logoClass" src="../static/Jio-Logo.png" alt="Jio Logo" />
|
| 128 |
+
</div>
|
| 129 |
+
<div>AI Assist Powered by JioGPT</div>
|
| 130 |
+
</div>
|
| 131 |
+
<div class="upload-form">
|
| 132 |
+
<form action="/file_upload" method="post" enctype="multipart/form-data">
|
| 133 |
+
<label for="file">Choose KnowledgeBase PDF files to upload:</label>
|
| 134 |
+
<input type="file" name="files[]" id="file" multiple="true" accept=".pdf">
|
| 135 |
+
<br>
|
| 136 |
+
<br>
|
| 137 |
+
<label for="weburl">Add your KnowledgeBase URL:</label>
|
| 138 |
+
<input type="url" id="weburl" name="weburl">
|
| 139 |
+
<input type="submit" value="Upload">
|
| 140 |
+
</form>
|
| 141 |
+
</div>
|
| 142 |
</div>
|
| 143 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
</html>
|