Skip to content

Commit

Permalink
Update main.css
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanleclaire committed Jun 24, 2024
1 parent 10c54da commit 06d55fa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ from bs4 import BeautifulSoup
import logging
from datasets import load_dataset

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")

BASE_URL = "https://sacred-texts.com/eso/sta/sta{:02d}.htm"
OUTPUT_DIR = "secret_teachings_content"
Expand All @@ -48,27 +48,27 @@ NUM_PAGES = 50
def fetch_and_save_content(url, filename):
if os.path.exists(filename):
logging.info(f"File {filename} already exists, skipping download")
with open(filename, 'r', encoding='utf-8') as f:
with open(filename, "r", encoding="utf-8") as f:
return f.read()

logging.info(f"Fetching content from {url}")
response = requests.get(url)
response.raise_for_status()

content = response.text
with open(filename, 'w', encoding='utf-8') as f:
with open(filename, "w", encoding="utf-8") as f:
f.write(content)

return content

def parse_content(html_content):
soup = BeautifulSoup(html_content, 'html.parser')
paragraphs = soup.find_all('p')
soup = BeautifulSoup(html_content, "html.parser")
paragraphs = soup.find_all("p")
return [p.get_text().strip() for p in paragraphs if p.get_text().strip()]

def split_paragraph(paragraph):
sentences = paragraph.split('. ')
return [s.strip() + '.' for s in sentences if s.strip()]
sentences = paragraph.split(". ")
return [s.strip() + "." for s in sentences if s.strip()]

def generate_conversation(paragraph):
sentences = split_paragraph(paragraph)
Expand All @@ -89,7 +89,7 @@ def generate_training_data(content_dir):
conversations = []
for filename in os.listdir(content_dir):
if filename.endswith(".html"):
with open(os.path.join(content_dir, filename), 'r', encoding='utf-8') as f:
with open(os.path.join(content_dir, filename), "r", encoding="utf-8") as f:
content = f.read()
paragraphs = parse_content(content)
for paragraph in paragraphs:
Expand All @@ -111,7 +111,7 @@ def main():
training_data = generate_training_data(OUTPUT_DIR)

logging.info(f"Saving training data to {JSON_OUTPUT}")
with open(JSON_OUTPUT, 'w', encoding='utf-8') as f:
with open(JSON_OUTPUT, "w", encoding="utf-8") as f:
json.dump(training_data, f, ensure_ascii=False, indent=2)

logging.info("Process completed successfully")
Expand Down Expand Up @@ -262,4 +262,4 @@ Hopefully this is helpful to some other people doing LLM fine tuning at home.

Until next time, stay sassy Internet.

* N
* N
55 changes: 22 additions & 33 deletions static/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ body {
padding: 0;
border-top: 8px solid #333;
font-family: "Lato", sans-serif;
font-size: 16px;
font-size: 20px;
line-height: 32px;
color: #333;
}

Expand All @@ -36,7 +37,8 @@ body {
width: 90%;
}
article {
font-size: 18px !important;
font-size: 20px !important;
line-height: 32px !important;
}
}

Expand All @@ -53,21 +55,6 @@ pre {

}

h1 {
margin-top: 0.9em;
font-size: 1.3em;
font-weight: normal;
font-style: normal;
text-align: center;
}

h2 {
margin-top: 0.9em;
font-size: 1em;
font-weight: bold;
font-style: normal;
}

.wrap>footer {
margin-top: 2em;
padding: 2em 0;
Expand Down Expand Up @@ -178,14 +165,6 @@ article header {
text-align: center;
}

article header h1 {
font-size: 1.5em;
font-weight: bold;
font-style: normal;
line-height: 1em;
text-align: center;
}

article header time {
font-size: 0.9em;
font-style: normal;
Expand All @@ -200,9 +179,11 @@ article hr {
}

#content img {
max-width: 100%;
margin: 4px auto;
display: block;
max-width: 100%;
max-height: 512px;
margin: 4px auto;
display: block;
height: auto;
}

article p .word1,article p .word2,article p .word3 {
Expand Down Expand Up @@ -328,11 +309,14 @@ iframe {
}

div#content {
margin: 0% 26%; /* default margin for larger screens */
margin: 0% 12%; /* default margin for larger screens */
}

@media only screen and (max-width: 767px) {
/* small screens */
#wrap {
padding: 0px 10px;
}
div#content {
margin: 0% 5px; /* 5px margin on small screens */
}
Expand Down Expand Up @@ -389,10 +373,6 @@ li.title {
text-align: left;
}

h1,h2,h3,h4,h5,h6 {
font-weight: bold;
}

input#reader-email {
border-radius: 5px;
width: 80%;
Expand Down Expand Up @@ -753,3 +733,12 @@ input#archive-search {
display: block;
width: 200px;
}

p > code {
border-radius: 6px;
padding: 1px;
margin: 1px;
color: rgb(31, 35, 40, 0.9);
background-color: rgba(175, 184, 193, 0.2);
border: 1px solid rgb(31, 35, 40);
}

0 comments on commit 06d55fa

Please sign in to comment.