Update index.html
Browse files- index.html +8 -160
index.html
CHANGED
|
@@ -5,118 +5,17 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>LLM Prompt Tester For Research</title>
|
| 7 |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap">
|
| 8 |
-
<style>
|
| 9 |
-
* {
|
| 10 |
-
box-sizing: border-box;
|
| 11 |
-
}
|
| 12 |
-
body {
|
| 13 |
-
font-family: 'Inter', sans-serif;
|
| 14 |
-
background: linear-gradient(to right, #ede9fe, #f3e8ff);
|
| 15 |
-
color: #374151;
|
| 16 |
-
margin: 0;
|
| 17 |
-
padding: 20px;
|
| 18 |
-
display: flex;
|
| 19 |
-
justify-content: center;
|
| 20 |
-
align-items: center;
|
| 21 |
-
min-height: 100vh;
|
| 22 |
-
}
|
| 23 |
-
.container {
|
| 24 |
-
background: #faf5ff;
|
| 25 |
-
padding: 32px;
|
| 26 |
-
border-radius: 24px;
|
| 27 |
-
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
| 28 |
-
width: 100%;
|
| 29 |
-
max-width: 800px;
|
| 30 |
-
border: 2px solid #c4b5fd;
|
| 31 |
-
}
|
| 32 |
-
h1 {
|
| 33 |
-
text-align: center;
|
| 34 |
-
margin-bottom: 24px;
|
| 35 |
-
font-size: 28px;
|
| 36 |
-
font-weight: 600;
|
| 37 |
-
color: #6b21a8;
|
| 38 |
-
}
|
| 39 |
-
label {
|
| 40 |
-
display: block;
|
| 41 |
-
margin: 14px 0 6px;
|
| 42 |
-
font-weight: 600;
|
| 43 |
-
color: #6b21a8;
|
| 44 |
-
}
|
| 45 |
-
textarea, select, input[type="text"] {
|
| 46 |
-
width: 100%;
|
| 47 |
-
padding: 12px;
|
| 48 |
-
margin-bottom: 16px;
|
| 49 |
-
border-radius: 10px;
|
| 50 |
-
border: 1px solid #ddd6fe;
|
| 51 |
-
font-size: 16px;
|
| 52 |
-
font-family: inherit;
|
| 53 |
-
}
|
| 54 |
-
textarea {
|
| 55 |
-
min-height: 120px;
|
| 56 |
-
resize: vertical;
|
| 57 |
-
}
|
| 58 |
-
input[type="file"] {
|
| 59 |
-
display: none;
|
| 60 |
-
}
|
| 61 |
-
.custom-file-upload {
|
| 62 |
-
display: inline-block;
|
| 63 |
-
padding: 12px 24px;
|
| 64 |
-
background-color: #8b5cf6;
|
| 65 |
-
color: white;
|
| 66 |
-
font-weight: 600;
|
| 67 |
-
border-radius: 10px;
|
| 68 |
-
cursor: pointer;
|
| 69 |
-
margin-bottom: 8px;
|
| 70 |
-
}
|
| 71 |
-
button {
|
| 72 |
-
background-color: #8b5cf6;
|
| 73 |
-
color: white;
|
| 74 |
-
font-weight: 600;
|
| 75 |
-
border: none;
|
| 76 |
-
padding: 14px;
|
| 77 |
-
border-radius: 10px;
|
| 78 |
-
font-size: 16px;
|
| 79 |
-
cursor: pointer;
|
| 80 |
-
width: 100%;
|
| 81 |
-
margin-top: 12px;
|
| 82 |
-
}
|
| 83 |
-
button:hover {
|
| 84 |
-
background-color: #7c3aed;
|
| 85 |
-
}
|
| 86 |
-
.loading {
|
| 87 |
-
font-size: 16px;
|
| 88 |
-
font-weight: bold;
|
| 89 |
-
color: #6b21a8;
|
| 90 |
-
animation: pulse 1s infinite;
|
| 91 |
-
margin: 10px 0;
|
| 92 |
-
}
|
| 93 |
-
@keyframes pulse {
|
| 94 |
-
0% { opacity: 0.3; }
|
| 95 |
-
50% { opacity: 1; }
|
| 96 |
-
100% { opacity: 0.3; }
|
| 97 |
-
}
|
| 98 |
-
pre {
|
| 99 |
-
background: #f5f3ff;
|
| 100 |
-
border: 1px solid #e9d5ff;
|
| 101 |
-
padding: 16px;
|
| 102 |
-
border-radius: 10px;
|
| 103 |
-
white-space: pre-wrap;
|
| 104 |
-
margin-top: 10px;
|
| 105 |
-
}
|
| 106 |
-
.download {
|
| 107 |
-
text-align: center;
|
| 108 |
-
margin-top: 20px;
|
| 109 |
-
}
|
| 110 |
-
</style>
|
| 111 |
</head>
|
| 112 |
<body>
|
|
|
|
| 113 |
<div class="container">
|
| 114 |
<h1>LLM Prompt Tester For Research</h1>
|
| 115 |
|
| 116 |
<label for="model">Choose Model:</label>
|
| 117 |
<select id="model">
|
| 118 |
-
<option value="google/gemma-
|
| 119 |
-
<option value="deepseek/deepseek-
|
| 120 |
</select>
|
| 121 |
|
| 122 |
<label for="prompt">Enter a Prompt:</label>
|
|
@@ -131,7 +30,7 @@
|
|
| 131 |
|
| 132 |
<button onclick="send()">Send Prompt</button>
|
| 133 |
|
| 134 |
-
<div id="loading" class="loading" style="display:none;"
|
| 135 |
|
| 136 |
<h3>Response:</h3>
|
| 137 |
<pre id="response"></pre>
|
|
@@ -140,59 +39,8 @@
|
|
| 140 |
<button onclick="downloadCSV()">Download Results as CSV</button>
|
| 141 |
</div>
|
| 142 |
</div>
|
| 143 |
-
|
| 144 |
-
<script>
|
| 145 |
-
const results = [];
|
| 146 |
-
// const key = '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'; // replace this with your actual key
|
| 147 |
-
|
| 148 |
-
document.getElementById('fileUpload').addEventListener('change', async function () {
|
| 149 |
-
const file = this.files[0];
|
| 150 |
-
if (!file) return;
|
| 151 |
-
|
| 152 |
-
// Show file name preview
|
| 153 |
-
document.getElementById("fileName").textContent = `📂 Selected: ${file.name}`;
|
| 154 |
-
|
| 155 |
-
const text = await file.text();
|
| 156 |
-
const prompts = text.split(/\r?\n/).filter(Boolean);
|
| 157 |
-
|
| 158 |
-
document.getElementById("loading").style.display = "block"; // show loading
|
| 159 |
-
|
| 160 |
-
for (const prompt of prompts) {
|
| 161 |
-
await send(prompt);
|
| 162 |
-
}
|
| 163 |
-
|
| 164 |
-
document.getElementById("loading").style.display = "none"; // hide loading
|
| 165 |
-
});
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
async function send(overridePrompt) {
|
| 169 |
-
const model = document.getElementById("model").value;
|
| 170 |
-
const prompt = overridePrompt || document.getElementById("prompt").value;
|
| 171 |
-
|
| 172 |
-
const res = await fetch("/api/send", { // 👈 no localhost needed, Hugging Face serves it
|
| 173 |
-
method: "POST",
|
| 174 |
-
headers: { "Content-Type": "application/json" },
|
| 175 |
-
body: JSON.stringify({ model, prompt })
|
| 176 |
-
});
|
| 177 |
-
|
| 178 |
-
const data = await res.json();
|
| 179 |
-
const output = data.choices?.[0]?.message?.content || JSON.stringify(data);
|
| 180 |
-
document.getElementById("response").textContent = output;
|
| 181 |
-
|
| 182 |
-
results.push({ model, prompt, output });
|
| 183 |
-
}
|
| 184 |
-
|
| 185 |
-
function downloadCSV() {
|
| 186 |
-
let csv = "Model,Prompt,Output\n";
|
| 187 |
-
results.forEach(row => {
|
| 188 |
-
csv += `"${row.model}","${row.prompt.replace(/\n/g, " ")}","${row.output.replace(/\n/g, " ")}"\n`;
|
| 189 |
-
});
|
| 190 |
-
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
| 191 |
-
const link = document.createElement("a");
|
| 192 |
-
link.href = URL.createObjectURL(blob);
|
| 193 |
-
link.download = "llm_test_results.csv";
|
| 194 |
-
link.click();
|
| 195 |
-
}
|
| 196 |
-
</script>
|
| 197 |
</body>
|
|
|
|
|
|
|
|
|
|
| 198 |
</html>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>LLM Prompt Tester For Research</title>
|
| 7 |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap">
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
</head>
|
| 10 |
<body>
|
| 11 |
+
<body>
|
| 12 |
<div class="container">
|
| 13 |
<h1>LLM Prompt Tester For Research</h1>
|
| 14 |
|
| 15 |
<label for="model">Choose Model:</label>
|
| 16 |
<select id="model">
|
| 17 |
+
<option value="google/gemma-3-27b-it:free">Google Gemma</option>
|
| 18 |
+
<option value="deepseek/deepseek-chat-v3.1:free">DeepSeek Chat v3</option>
|
| 19 |
</select>
|
| 20 |
|
| 21 |
<label for="prompt">Enter a Prompt:</label>
|
|
|
|
| 30 |
|
| 31 |
<button onclick="send()">Send Prompt</button>
|
| 32 |
|
| 33 |
+
<div id="loading" class="loading" style="display:none;"> Processing prompts... Please wait.</div>
|
| 34 |
|
| 35 |
<h3>Response:</h3>
|
| 36 |
<pre id="response"></pre>
|
|
|
|
| 39 |
<button onclick="downloadCSV()">Download Results as CSV</button>
|
| 40 |
</div>
|
| 41 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
</body>
|
| 43 |
+
|
| 44 |
+
<script src="app.js"></script>
|
| 45 |
+
|
| 46 |
</html>
|