From 06d55faa72dcd1e64571327103781625992ced89 Mon Sep 17 00:00:00 2001 From: Nathan LeClaire Date: Sun, 23 Jun 2024 08:41:18 -0700 Subject: [PATCH] Update main.css --- ...ssistant-with-llama-3-and-unsloth.markdown | 20 +++---- static/stylesheets/main.css | 55 ++++++++----------- 2 files changed, 32 insertions(+), 43 deletions(-) diff --git a/content/post/fine-tuning-a-mystical-assistant-with-llama-3-and-unsloth.markdown b/content/post/fine-tuning-a-mystical-assistant-with-llama-3-and-unsloth.markdown index f3b2867..d72ad27 100644 --- a/content/post/fine-tuning-a-mystical-assistant-with-llama-3-and-unsloth.markdown +++ b/content/post/fine-tuning-a-mystical-assistant-with-llama-3-and-unsloth.markdown @@ -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" @@ -48,7 +48,7 @@ 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}") @@ -56,19 +56,19 @@ def fetch_and_save_content(url, filename): 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) @@ -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: @@ -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") @@ -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 \ No newline at end of file +* N diff --git a/static/stylesheets/main.css b/static/stylesheets/main.css index 295e1f8..1bda4f2 100644 --- a/static/stylesheets/main.css +++ b/static/stylesheets/main.css @@ -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; } @@ -36,7 +37,8 @@ body { width: 90%; } article { - font-size: 18px !important; + font-size: 20px !important; + line-height: 32px !important; } } @@ -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; @@ -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; @@ -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 { @@ -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 */ } @@ -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%; @@ -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); +}