Skip to content

Commit 0bfeae0

Browse files
committed
logo
1 parent a0ccdbe commit 0bfeae0

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def init_db():
5151

5252
async def generate_chunk(api, model, topic, current_word_count, language, is_new_chapter=False):
5353
if is_new_chapter:
54-
prompt = f"Write a detailed chapter for a book about {topic} in {language}. This is around word {current_word_count} of the book. Start with a chapter title, then write at least 500 words of content."
54+
prompt = f"Write a detailed chapter for a book about {topic} in {language}. This is around word {current_word_count} of the book. Start with a chapter title, then write at least {current_word_count} words of content."
5555
else:
56-
prompt = f"Continue writing a detailed book about {topic} in {language}. This is around word {current_word_count} of the book. Write at least 500 words, ensuring the narrative flows smoothly from the previous section."
56+
prompt = f"Continue writing a detailed book about {topic} in {language}. This is around word {current_word_count} of the book. Write at least {current_word_count} words, ensuring the narrative flows smoothly from the previous section."
5757

5858
try:
5959
if api == 'openai':
@@ -78,7 +78,7 @@ async def generate_chunk(api, model, topic, current_word_count, language, is_new
7878
response = together_client.chat.completions.create(
7979
model=model,
8080
messages=[
81-
{"role": "system", "content": f"You are an author writing a detailed book in {language}. Provide long, comprehensive responses with at least 500 words per chunk."},
81+
{"role": "system", "content": f"You are an author writing a detailed book in {language}. Provide long, comprehensive responses with at least {current_word_count} words per chunk."},
8282
{"role": "user", "content": prompt}
8383
],
8484
max_tokens=2000,
@@ -92,7 +92,7 @@ async def generate_chunk(api, model, topic, current_word_count, language, is_new
9292

9393
# Ensure minimum word count
9494
while len(generated_text.split()) < 500:
95-
additional_prompt = f"Continue the previous text, adding more details and expanding the narrative. Write at least {500 - len(generated_text.split())} more words."
95+
additional_prompt = f"Continue the previous text, adding more details and expanding the narrative. Write at least {current_word_count} more words."
9696
additional_response = together_client.chat.completions.create(
9797
model=model,
9898
messages=[

pdfs.db

0 Bytes
Binary file not shown.
747 KB
Binary file not shown.
5.37 KB
Binary file not shown.
2.88 KB
Binary file not shown.

templates/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@
9494
<div
9595
class="w-full lg:w-96 bg-white shadow-2xl p-6 lg:p-8 flex flex-col rounded-3xl transition-all duration-300 hover:shadow-3xl mobile-full-width glass-effect">
9696
<div class="flex justify-between items-center mb-6 lg:mb-10">
97-
<img src="https://raw.githubusercontent.com/Adarshagupta/BookAI/main/logo.png" alt="BookAI Logo"
98-
class="w-12 h-10">
97+
9998
<button id="profile-button" class="text-gray-600 hover:text-gray-800 mr-4">
10099
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
101100
stroke="currentColor">
102101
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
103102
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
104103
</svg>
105104
</button>
105+
<img src="https://raw.githubusercontent.com/Adarshagupta/BookAI/main/logo.png" alt="BookAI Logo"
106+
class="w-12 h-10">
106107
<button id="settings-button" class="text-gray-600 hover:text-gray-800">
107108
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
108109
stroke="currentColor">
@@ -133,7 +134,7 @@
133134
<option value="gpt-4-turbo">GPT-4-turbo</option>
134135
<option value="gpt-4o-mini-2024-07-18">GPT-4o Mini (2024-07-18)</option>
135136
</optgroup>
136-
<optgroup label="Together Models" id="together-models">
137+
<optgroup label="BookAI Models" id="together-models">
137138
<option value="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo">BookAI-8B-Instruct-Turbo</option>
138139
<option value="meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo">BookAI-70B-Instruct-Turbo</option>
139140
</optgroup>

0 commit comments

Comments
 (0)