Skip to content

Commit 6c73671

Browse files
authored
Merge pull request #84 from premAI-io/email-modal
2 parents 5bd0dd9 + 50ba949 commit 6c73671

File tree

8 files changed

+149
-40
lines changed

8 files changed

+149
-40
lines changed

_config.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,23 @@ parse:
5959
6060
<div id="email-modal" class="modal">
6161
<div class="modal-content">
62-
<!--<div class="header"><span class="close">&times;</span></div>-->
63-
<label for="name">To access this book for free, please enter your email. We won't spam you!</label>
64-
<input type="email" id="email" name="email" />
65-
<button id="email-submit" onclick="emailButtonClick()">Submit</button>
66-
<span class="email-error"></span>
62+
<img src="https://static.premai.io/book/book-cover.jpg" alt="book cover" />
63+
<div class="modal-text">
64+
<h1>Enter your email to access this book for free</h1>
65+
<p>
66+
We&rsquo;ll send you updates whenever we make major changes<br />
67+
(no spam nor giving your email to anyone else).
68+
</p>
69+
<div class="input-container">
70+
<input type="email" id="email-input" name="email" placeholder="Enter your email..." />
71+
<button id="email-submit" onclick="emailButtonClick()">Subscribe</button>
72+
</div>
73+
<span class="email-error"></span>
74+
<p>
75+
This book is open source; you can also read &amp; contribute at<br />
76+
<a href="https://github.com/premAI-io/state-of-open-source-ai" target="_blank"><i class="fa-brands fa-github"></i>&nbsp;premAI-io/state-of-open-source-ai</a>.
77+
</p>
78+
</div>
6779
</div>
6880
</div>
6981
myst_enable_extensions: # https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html

_static/emails.css

Lines changed: 97 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,132 @@
55
top: 0;
66
width: 100%;
77
height: 100%;
8-
background-color: rgba(0, 0, 0, 0.4);
8+
background-color: rgba(0, 0, 0, 0.8);
99
}
1010

1111
.modal-content {
1212
display: flex;
13+
flex-direction: row;
1314
margin: 15% auto;
14-
width: 50vw;
15-
padding: 30px;
15+
width: 60vw;
16+
padding: 80px 40px;
17+
background-color: rgba(20, 20, 20, 1);
1618
box-shadow: 0 0 22px 1px black;
19+
gap: 30px;
20+
align-items: center;
21+
}
22+
23+
@media only screen and (max-width: 480px) {
24+
.modal-content {
25+
width: 90vw !important;
26+
flex-direction: column !important;
27+
}
28+
.modal-content input {
29+
font-size: 0.9rem !important;
30+
}
31+
.modal-content button {
32+
padding: 10px !important;
33+
}
34+
.modal-content img {
35+
width: 50vw !important;
36+
}
37+
}
38+
39+
@media only screen and (min-width: 481px) and (max-width: 1022px) {
40+
.modal-content {
41+
width: 70vw !important;
42+
flex-direction: column !important;
43+
}
44+
.modal-content input {
45+
font-size: 0.95rem !important;
46+
}
47+
.modal-content img {
48+
width: 30vw !important;
49+
}
50+
}
51+
52+
.modal-content img {
53+
width: 20vw;
1754
}
1855

1956
.modal-content .header {
2057
display: flex;
2158
justify-content: flex-end;
2259
}
2360

24-
.modal-content label {
25-
font-size: 1.2em;
26-
}
27-
2861
.modal-content input {
29-
border: 1px solid #F58E8E;
30-
border-radius: 3px;
62+
border: none;
63+
background-color: transparent;
3164
margin: 10px 0;
65+
flex: 1;
66+
color: rgba(255, 255, 255, 0.70);
67+
font-size: 1rem;
68+
font-style: normal;
69+
font-weight: 400;
70+
line-height: normal;
71+
width: 100%;
3272
}
3373

3474
.modal-content input:focus {
3575
outline: none !important;
36-
box-shadow: 0 0 10px #F58E8E;
3776
}
3877

3978
.modal-content button {
40-
color: black;
41-
background-color: #F58E8E;
79+
color: white;
4280
border: none;
43-
border-radius: 3px;
44-
font-size: 1.3em;
81+
text-align: center;
82+
font-size: 0.8rem;
83+
font-style: normal;
84+
font-weight: 700;
85+
line-height: 24px;
86+
border-radius: 6px;
87+
background: linear-gradient(90deg, #F58E8E 0%, #F1B370 100%);
88+
padding: 10px 24px;
4589
}
4690

47-
/*
48-
.close {
49-
color: black;
50-
font-size: 28px;
91+
.modal-content .email-error {
92+
display: flex;
93+
color: red;
94+
font-size: 0.9em;
95+
margin-top: 4px;
96+
}
97+
98+
.modal-content .input-container {
99+
display: flex;
100+
padding: 18px 16px;
101+
align-items: center;
102+
align-self: stretch;
103+
border-radius: 12px;
104+
border: 1px solid rgba(255, 255, 255, 0.20);
105+
}
106+
107+
.modal-content h1 {
108+
color: #FFF;
109+
font-size: 1.3rem;
110+
font-style: normal;
51111
font-weight: bold;
112+
line-height: normal;
52113
}
53114

54-
.close:hover,
55-
.close:focus {
56-
color: #F58E8E;
115+
.modal-content p {
116+
color: #FFF;
117+
font-size: 1rem;
118+
font-style: normal;
119+
font-weight: 400;
120+
line-height: 26px;
121+
}
122+
123+
.modal-content .modal-text {
124+
flex: 1;
125+
overflow: auto;
126+
}
127+
128+
.modal-content a {
57129
text-decoration: none;
58-
cursor: pointer;
130+
color: #F58E8E;
59131
}
60-
*/
61132

62-
.modal-content .email-error {
63-
color: red;
64-
font-size: 0.9em;
65-
margin-top: 4px;
133+
.modal-content a:hover {
134+
text-decoration: none;
135+
color: #F1B370;
66136
}

_static/emails.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function getCookie(cname) {
2121
}
2222

2323
async function emailButtonClick() {
24-
let emailInput = document.getElementById("email");
24+
let emailInput = document.getElementById("email-input");
2525
let emailValue = emailInput.value;
2626
let res = await fetch("https://premai.pythonanywhere.com/email?a=" + emailValue);
2727
const ok = 200 <= res.status && res.status < 299;
@@ -43,11 +43,17 @@ async function emailButtonClick() {
4343
document.addEventListener('DOMContentLoaded', function() {
4444
let modal = document.getElementById('email-modal');
4545
let email = getCookie("address");
46+
let emailInput = document.getElementById("email-input");
4647
if (email === "" || email == null) {
4748
modal.style.display = 'block';
48-
let emailInput = document.getElementById("email");
4949
emailInput.value = "";
5050
}
51-
//let closeModalBtn = modal.querySelector('.close');
52-
//closeModalBtn.addEventListener('click', () => modal.style.display = 'none');
51+
emailInput.focus()
52+
// When user click Enter, click the submit button
53+
emailInput.addEventListener("keypress", function(event) {
54+
if (event.key === "Enter") {
55+
event.preventDefault();
56+
document.getElementById("email-submit").click();
57+
}
58+
});
5359
});

_static/external_target.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
a.reference.external:after {
2-
content: "\2b77";
2+
content: "";
33
font-size: .7em;
44
vertical-align: text-top;
55
margin-left: .1em;

_static/font.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@font-face {
2+
font-family: "Pretendard";
3+
src: url("https://static.premai.io/fonts/Pretendard-Regular.woff2") format("woff2");
4+
font-weight: normal;
5+
}
6+
7+
@font-face {
8+
font-family: "Pretendard";
9+
src: url("https://static.premai.io/fonts/Pretendard-SemiBold.woff2") format("woff2");
10+
font-weight: 600;
11+
}
12+
13+
@font-face {
14+
font-family: "Pretendard";
15+
src: url("https://static.premai.io/fonts/Pretendard-Bold.woff2") format("woff2");
16+
font-weight: bold;
17+
}
18+
19+
* {
20+
font-family: Pretendard, sans-serif;
21+
}

fine-tuning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Some ideas:
1010
- [Why You (Probably) Don't Need to Fine-tune an LLM](https://www.tidepool.so/2023/08/17/why-you-probably-dont-need-to-fine-tune-an-llm/) (instead, use few-shot prompting & retrieval-augmented generation)
1111
- [Fine-Tuning LLaMA-2: A Comprehensive Case Study for Tailoring Models to Unique Applications](https://www.anyscale.com/blog/fine-tuning-llama-2-a-comprehensive-case-study-for-tailoring-models-to-unique-applications) (fine-tuning LLaMA-2 for 3 real-world use cases)
1212
- [Private, local, open source LLMs](https://python.langchain.com/docs/guides/local_llms)
13-
- [Easy-to-use LLM fine-tuning framework (LLaMA-2, BLOOM, Falcon, Baichuan, Qwen, ChatGLM2)](https://github.com/hiyouga/LLaMA-Efficient-Tuning)
13+
- [Easy-to-use LLM fine-tuning framework (LLaMA-2, BLOOM, Falcon, Baichuan, Qwen, ChatGLM2)](https://github.com/hiyouga/LLaMA-Factory)
1414
- https://dstack.ai/examples/finetuning-llama-2
1515
- https://github.com/h2oai, etc.
1616
- [The History of Open-Source LLMs: Better Base Models (part 2)](https://cameronrwolfe.substack.com/p/the-history-of-open-source-llms-better) (LLaMA, MPT, Falcon, LLaMA-2)

references.bib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ @online{cursor-llama
413413
title={Why {GPT-3.5} is (mostly) cheaper than {LLaMA-2}},
414414
author={Aman},
415415
year=2023,
416-
url={https://www.cursor.so/blog/llama-inference}
416+
url={https://cursor.sh/blog/llama-inference}
417417
}
418418
@online{vector-indexing,
419419
title={Vector databases: Not all indexes are created equal},

references.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Couldn't decide which chapter(s) these links are related to. They're mostly abou
3232
- "How I Re-implemented PyTorch for WebGPU" (`webgpu-torch`: inference & autograd lib to run NNs in browser with negligible overhead) https://praeclarum.org/2023/05/19/webgpu-torch.html
3333
- "LLaMA from scratch (or how to implement a paper without crying)" (misc tips, scaled-down version of LLaMA for training) https://blog.briankitano.com/llama-from-scratch
3434
- "Swift Transformers: Run On-Device LLMs in Apple Devices" https://huggingface.co/blog/swift-coreml-llm
35-
- "Why GPT-3.5-turbo is (mostly) cheaper than LLaMA-2" https://www.cursor.so/blog/llama-inference#user-content-fn-gpt4-leak
35+
- "Why GPT-3.5-turbo is (mostly) cheaper than LLaMA-2" https://cursor.sh/blog/llama-inference#user-content-fn-gpt4-leak
3636
- http://marble.onl/posts/why_host_your_own_llm.html
3737
- https://betterprogramming.pub/you-dont-need-hosted-llms-do-you-1160b2520526
3838
- "Low-code framework for building custom LLMs, neural networks, and other AI models" https://github.com/ludwig-ai/ludwig

0 commit comments

Comments
 (0)