Skip to content

Commit a4ba9ee

Browse files
committed
Add favicon and about page, fix up some styling and add links
1 parent 4a071c8 commit a4ba9ee

File tree

6 files changed

+85
-1
lines changed

6 files changed

+85
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*~
22
.*.swp
33
.DS_Store
4+
/build

nlmserver/main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ func main() {
3030

3131
templates := template.Must(template.New("web").ParseFS(templateFiles, "templates/*"))
3232

33+
log.Printf("Loading articles...")
34+
start := time.Now()
3335
articleBuilder, err := nlm.NewArticleBuilder(size)
3436
if err != nil {
3537
log.Fatalf("Error creating article builder: %s", err)
3638
}
39+
elapsed := time.Now().Sub(start)
40+
log.Printf("Time elapsed loading articles: %s", elapsed)
3741

3842
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
3943
if r.URL.Path != "/" {
@@ -47,6 +51,14 @@ func main() {
4751
}
4852
})
4953

54+
mux.HandleFunc("/about", func(w http.ResponseWriter, r *http.Request) {
55+
aboutTemplate := templates.Lookup("about.html")
56+
err := aboutTemplate.Execute(w, nil)
57+
if err != nil {
58+
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
59+
}
60+
})
61+
5062
mux.Handle("/generate", NewRateLimiter("X-Forwarded-For", 0.2, 4, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
5163
responseTemplate := templates.Lookup("article.html")
5264
errorTemplate := templates.Lookup("error.html")

nlmserver/static/favicon.png

1.78 KB
Loading

nlmserver/static/main.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ h5 {
3939
margin-bottom: 20px;
4040
}
4141

42+
.header a {
43+
color: black;
44+
text-decoration: none;
45+
}
46+
4247
.main {
4348
margin-top: 100px;
4449
padding: 10px;
@@ -47,6 +52,10 @@ h5 {
4752
flex: 1 0 auto;
4853
}
4954

55+
.main>h1 {
56+
text-align: center;
57+
}
58+
5059
.footer {
5160
padding: 10px;
5261
font-size: small;
@@ -57,6 +66,11 @@ h5 {
5766
.header {
5867
flex-flow: column nowrap;
5968
align-items: center;
69+
position: static;
70+
}
71+
72+
.main {
73+
margin-top: 20px;
6074
}
6175
}
6276

nlmserver/templates/about.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<title>No Language Model</title>
9+
<link rel="icon" href="static/favicon.png" />
10+
<link href="static/main.css" rel="stylesheet" />
11+
</head>
12+
13+
<body class="fullpage">
14+
<header class="header">
15+
<h1 class="sitetitle"><a href="/">The Washed Up Post</a></h1>
16+
</header>
17+
<div class="main">
18+
<h1>About</h1>
19+
<p>This is a small project written by <a href="https://social.unnecessary.tech/u/nissyen">Christopher
20+
De&nbsp;Vries</a> to explore the current craze over Large Language Models like
21+
ChatGTP. ChatGPT is not magic, and it is not a general intelligence. The results it
22+
produces may seem extraordinary, but as we have <a
23+
href="https://www.reuters.com/legal/transactional/lawyer-used-chatgpt-cite-bogus-cases-what-are-ethics-2023-05-30/">recently
24+
seen</a>
25+
the remarkable results that we get from ChatGPT have no guarantee of being accurate. This
26+
reminded me of some work I had done with a very simple predictive algorithm back
27+
in the 90s.</p>
28+
<p>In contrast with Large Language Models like ChatGPT, this is a No Language Model.
29+
It is based on a <a href="https://en.wikipedia.org/wiki/Markov_chain">Markov chain</a>
30+
which is a process developed in 1906 by which we predict
31+
the next item in a list using the previous N items and a probability model
32+
based on existing sequences. In this case the existing sequence is just a sequence of letters
33+
from news articles about ChatGPT, and we predict the next letter
34+
based on the previous 5 letters.</p>
35+
<p>Markov chains can produce articles which look surprisingly similar to English
36+
text, but they contain no vocabulary database, know nothing of grammar, and have no
37+
understanding of the topic about which they write. A Markov chain is just a simple
38+
algorithm. LLMs may be more complex, but they fundamentally have similar limitations.
39+
To say that they “hallucinate” or “dream” is plainly false. They are inherently
40+
uncreative and unreliable, generating random babbel using a large volume of
41+
human-produced text.</p>
42+
<p>You can see how this site works by <a href="https://github.com/devries/nlm">exploring
43+
the code on github</a>.</p>
44+
</div>
45+
</body>
46+
47+
</html>

nlmserver/templates/index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55
<meta charset="utf-8" />
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<title>A web page</title>
8+
<title>No Language Model</title>
9+
<link rel="icon" href="static/favicon.png" />
910
<link href="static/main.css" rel="stylesheet" />
1011
<script src="https://unpkg.com/[email protected]"
1112
integrity="sha384-L6OqL9pRWyyFU3+/bjdSri+iIphTN/bvYyM37tICVyOJkWZLpP2vGn6VUEXgzg6h"
1213
crossorigin="anonymous"></script>
14+
<script>
15+
htmx.on("htmx:sendError", function (evt) {
16+
window.alert("Error sending request");
17+
});
18+
htmx.on("htmx:timeout", function (evt) {
19+
window.alert("Connection timed out");
20+
});
21+
</script>
1322
</head>
1423

1524
<body class="fullpage">
@@ -19,6 +28,7 @@ <h1 class="sitetitle">The Washed Up Post</h1>
1928
</header>
2029
<div class="main" id="content" hx-get="/generate" hx-trigger="load">
2130
</div>
31+
<footer class="footer"><a href="/about">About</a></footer>
2232
</body>
2333

2434
</html>

0 commit comments

Comments
 (0)