Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- templates/index.html +33 -1
templates/index.html
CHANGED
|
@@ -43,6 +43,24 @@
|
|
| 43 |
border-radius: 6px;
|
| 44 |
min-height: 100px;
|
| 45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
</style>
|
| 47 |
</head>
|
| 48 |
<body>
|
|
@@ -54,6 +72,14 @@
|
|
| 54 |
<button type="submit">Submit</button>
|
| 55 |
</form>
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
<div class="response-box" id="response-box">
|
| 58 |
<strong>Response:</strong>
|
| 59 |
<p id="response-text">Waiting for input...</p>
|
|
@@ -63,11 +89,17 @@
|
|
| 63 |
<script>
|
| 64 |
const form = document.getElementById('query-form');
|
| 65 |
const responseText = document.getElementById('response-text');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
form.addEventListener('submit', async function (e) {
|
| 68 |
e.preventDefault();
|
| 69 |
|
| 70 |
-
const prompt =
|
| 71 |
|
| 72 |
const response = await fetch('/predict/qlora', {
|
| 73 |
method: 'POST',
|
|
|
|
| 43 |
border-radius: 6px;
|
| 44 |
min-height: 100px;
|
| 45 |
}
|
| 46 |
+
.suggestions {
|
| 47 |
+
margin-top: 1rem;
|
| 48 |
+
padding: 1rem;
|
| 49 |
+
background-color: #fff8e1;
|
| 50 |
+
border: 1px solid #ffd54f;
|
| 51 |
+
border-radius: 8px;
|
| 52 |
+
}
|
| 53 |
+
.suggestions span {
|
| 54 |
+
display: block;
|
| 55 |
+
cursor: pointer;
|
| 56 |
+
padding: 5px;
|
| 57 |
+
margin: 4px 0;
|
| 58 |
+
background-color: #fff3cd;
|
| 59 |
+
border-radius: 5px;
|
| 60 |
+
}
|
| 61 |
+
.suggestions span:hover {
|
| 62 |
+
background-color: #ffe082;
|
| 63 |
+
}
|
| 64 |
</style>
|
| 65 |
</head>
|
| 66 |
<body>
|
|
|
|
| 72 |
<button type="submit">Submit</button>
|
| 73 |
</form>
|
| 74 |
|
| 75 |
+
<div class="suggestions">
|
| 76 |
+
<strong>Not sure what to ask? Try one of these:</strong>
|
| 77 |
+
<span onclick="fillPrompt(`I'd like to know: Where is the registered office located?`)">Where is the registered office located?</span>
|
| 78 |
+
<span onclick="fillPrompt(`What can you say about this: What is the HR policy style of the company?`)">What is the HR policy style of the company?</span>
|
| 79 |
+
<span onclick="fillPrompt(`Which functions have the most employees at iGenerate?`)">Which functions have the most employees at iGenerate?</span>
|
| 80 |
+
<span onclick="fillPrompt(`Could you tell me what is the HR policy style of the company?`)">Tell me about the HR policy style.</span>
|
| 81 |
+
</div>
|
| 82 |
+
|
| 83 |
<div class="response-box" id="response-box">
|
| 84 |
<strong>Response:</strong>
|
| 85 |
<p id="response-text">Waiting for input...</p>
|
|
|
|
| 89 |
<script>
|
| 90 |
const form = document.getElementById('query-form');
|
| 91 |
const responseText = document.getElementById('response-text');
|
| 92 |
+
const promptTextarea = document.getElementById('prompt');
|
| 93 |
+
|
| 94 |
+
function fillPrompt(text) {
|
| 95 |
+
promptTextarea.value = text;
|
| 96 |
+
promptTextarea.focus();
|
| 97 |
+
}
|
| 98 |
|
| 99 |
form.addEventListener('submit', async function (e) {
|
| 100 |
e.preventDefault();
|
| 101 |
|
| 102 |
+
const prompt = promptTextarea.value;
|
| 103 |
|
| 104 |
const response = await fetch('/predict/qlora', {
|
| 105 |
method: 'POST',
|