-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
197 lines (178 loc) · 8.22 KB
/
index.html
1
2
3
4
5
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLM Dialog</title>
<link rel="icon" href="https://raw.githubusercontent.com/gramener/assets/main/straive-favicon.svg">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<style>
.narrative {
max-width: 40rem;
}
/* Add custom styling for range input markers */
datalist {
display: flex;
justify-content: space-between;
margin-top: 0.5rem;
font-size: 0.8rem;
color: var(--bs-body-color);
}
datalist option {
padding: 0;
display: flex;
align-items: center;
position: relative;
}
datalist option::before {
content: attr(value);
}
/* Add tick marks */
datalist option::after {
content: '';
width: 1px;
height: 0.5rem;
background: currentColor;
position: absolute;
top: -0.8rem;
left: 50%;
transform: translateX(-50%);
}
#dialog-history td {
cursor: pointer;
}
#dialog-run,
#dialog-result {
scroll-margin-top: 3rem;
scroll-margin-bottom: 3rem;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href=".">LLM Dialog</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="nav-item dropdown ms-auto" role="group" aria-label="Toggle dark mode" title="Toggle Dark Mode">
<button class="dark-theme-toggle btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Toggle theme (auto)">
<i class="bi bi-circle-half"></i> <span class="d-lg-none ms-2">Toggle theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><button class="dropdown-item" data-bs-theme-value="light"><i class="me-2 bi bi-sun-fill"></i> Light</button></li>
<li><button class="dropdown-item" data-bs-theme-value="dark"><i class="me-2 bi bi-moon-stars-fill"></i> Dark</button></li>
<li><button class="dropdown-item" data-bs-theme-value="auto"><i class="me-2 bi bi-circle-half"></i> Auto</button></li>
</ul>
</div>
</div>
</div>
</nav>
<div class="container">
<h1 class="display-1 my-4 text-center">LLM Dialog</h1>
<h2 class="display-6 text-center">What if LLMs talked to each other?</h2>
<div class="mx-auto my-3 narrative">
<p>LLM Dialog is a tool to explore how LLMs talk to each other.</p>
<ul>
<li>Pick 2 models.</li>
<li>Give each of them instructions.</li>
<li>Start a conversation with one of them.</li>
<li>Keep clicking "Continue" to feed the result of their conversation back to them.</li>
</ul>
<p>The conversation will evolve as the models interact each other.</p>
</div>
<div id="demos" class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 row-cols-xl-4 my-5"></div>
<form id="dialog-form">
<div class="row mb-3">
<div class="col-md-6" data-bot-id="0">
<div class="row mb-3">
<label for="name0" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input class="form-control" name="name0" id="name0" placeholder="Name of bot" value="Bot 1">
</div>
</div>
<div class="row mb-3">
<label for="model0" class="col-sm-2 col-form-label">Model</label>
<div class="col-sm-10">
<select class="form-control" name="model0" id="model0" required></select>
</div>
</div>
<div class="row mb-3">
<label for="temperature0" class="col-sm-2 mb-3 col-form-label">Temperature</label>
<div class="col-sm-10">
<input class="form-range mt-2" name="temperature0" id="temperature0" type="range" min="0" max="1" step="0.01" value="0.5" list="markers0">
<datalist id="markers0">
<option value="0.0"></option>
<option value="0.2"></option>
<option value="0.4"></option>
<option value="0.6"></option>
<option value="0.8"></option>
<option value="1.0"></option>
</datalist>
</div>
</div>
<label for="prompt0" class="form-label d-none">System Instructions</label>
<textarea class="form-control mb-3" name="prompt0" id="prompt0" rows="3" placeholder="Instructions for bot 1" required></textarea>
<div class="row mb-3">
<label for="chat0" class="col-sm-2 col-form-label">Begin with</label>
<div class="col-sm-10">
<input class="form-control" name="chat0" id="chat1" placeholder="Conversation starter" required>
</div>
</div>
</div>
<div class="col-md-6" data-bot-id="1">
<div class="row mb-3">
<label for="name1" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input class="form-control" name="name1" id="name1" placeholder="Name of bot" value="Bot 2">
</div>
</div>
<div class="row mb-3">
<label for="model0" class="col-sm-2 col-form-label">Model</label>
<div class="col-sm-10">
<select class="form-control" name="model1" id="model0" required></select>
</div>
</div>
<div class="row mb-3">
<label for="temperature1" class="col-sm-2 mb-3 col-form-label">Temperature</label>
<div class="col-sm-10">
<input class="form-range mt-2" name="temperature1" id="temperature1" type="range" min="0" max="1" step="0.01" value="0.5" list="markers1">
<datalist id="markers1">
<option value="0.0"></option>
<option value="0.2"></option>
<option value="0.4"></option>
<option value="0.6"></option>
<option value="0.8"></option>
<option value="1.0"></option>
</datalist>
</div>
</div>
<label for="prompt1" class="form-label d-none">System Instructions</label>
<textarea class="form-control mb-3" name="prompt1" id="prompt1" rows="3" placeholder="Instructions for bot 2" required></textarea>
<div class="row mb-3">
<label for="n" class="col-sm-2 col-form-label">Context</label>
<div class="col-sm-10 d-flex align-items-center">
<input class="form-control w-auto" name="n" id="n" type="number" min="1" max="10" value="5" placeholder="Number of converations to remember" required>
<div class="form-text ms-2"># of previous conversations in history.</div>
</div>
</div>
</div>
</div>
<div id="dialog-result" class="my-4"></div>
<div class="d-flex justify-content-center">
<button type="submit" class="btn btn-primary me-2" id="dialog-run">Continue</button>
<button type="reset" class="btn btn-danger" id="dialog-reset">Restart conversation</button>
</div>
</form>
</div>
<div class="container my-4" id="dialog-history"></div>
<footer class="my-5 vh-100 d-flex align-items-center justify-content-center">
<h1 class="display-4">Designed by <a href="https://gramener.com/" class="text-reset link-offset-3 link-underline link-underline-opacity-25">Gramener</a></h1>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" type="module"></script>
<script src="https://cdn.jsdelivr.net/npm/@gramex/[email protected]/dist/dark-theme.js" type="module"></script>
<script src="script.js" type="module"></script>
</body>
</html>