Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +12 -7
index.html
CHANGED
|
@@ -3,18 +3,14 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<title>π AI Code Assistant</title>
|
| 6 |
-
<link rel="stylesheet" href="style.css">
|
| 7 |
</head>
|
| 8 |
<body>
|
| 9 |
<div class="container">
|
| 10 |
<h1>π€ Multi-Model Code Assistant</h1>
|
| 11 |
|
| 12 |
<label for="model">Select Model:</label>
|
| 13 |
-
<select id="model">
|
| 14 |
-
{% for m in models %}
|
| 15 |
-
<option value="{{ m }}">{{ m }}</option>
|
| 16 |
-
{% endfor %}
|
| 17 |
-
</select>
|
| 18 |
|
| 19 |
<div id="chatbox"></div>
|
| 20 |
|
|
@@ -27,12 +23,21 @@
|
|
| 27 |
<script>
|
| 28 |
let history = [];
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
document.getElementById("chat-form").addEventListener("submit", async (e) => {
|
| 31 |
e.preventDefault();
|
| 32 |
const userInput = document.getElementById("user-input").value;
|
| 33 |
const modelChoice = document.getElementById("model").value;
|
| 34 |
|
| 35 |
-
// Append user message
|
| 36 |
history.push(["user", userInput]);
|
| 37 |
document.getElementById("chatbox").innerHTML += `<div class="user">π§: ${userInput}</div>`;
|
| 38 |
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<title>π AI Code Assistant</title>
|
| 6 |
+
<link rel="stylesheet" href="/style.css">
|
| 7 |
</head>
|
| 8 |
<body>
|
| 9 |
<div class="container">
|
| 10 |
<h1>π€ Multi-Model Code Assistant</h1>
|
| 11 |
|
| 12 |
<label for="model">Select Model:</label>
|
| 13 |
+
<select id="model"></select>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
<div id="chatbox"></div>
|
| 16 |
|
|
|
|
| 23 |
<script>
|
| 24 |
let history = [];
|
| 25 |
|
| 26 |
+
// Fetch models dynamically
|
| 27 |
+
const models = ["DeepSeek Coder 1.3B", "StarCoder 1B", "CodeLLaMA 7B"];
|
| 28 |
+
const modelSelect = document.getElementById("model");
|
| 29 |
+
models.forEach(m => {
|
| 30 |
+
let opt = document.createElement("option");
|
| 31 |
+
opt.value = m;
|
| 32 |
+
opt.textContent = m;
|
| 33 |
+
modelSelect.appendChild(opt);
|
| 34 |
+
});
|
| 35 |
+
|
| 36 |
document.getElementById("chat-form").addEventListener("submit", async (e) => {
|
| 37 |
e.preventDefault();
|
| 38 |
const userInput = document.getElementById("user-input").value;
|
| 39 |
const modelChoice = document.getElementById("model").value;
|
| 40 |
|
|
|
|
| 41 |
history.push(["user", userInput]);
|
| 42 |
document.getElementById("chatbox").innerHTML += `<div class="user">π§: ${userInput}</div>`;
|
| 43 |
|