Update app.py
Browse files
app.py
CHANGED
@@ -92,85 +92,52 @@ def main():
|
|
92 |
|
93 |
# Add custom CSS
|
94 |
st.markdown("""
|
95 |
-
<style>
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
}
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
color: #1a1a1a;
|
125 |
-
background-color: #9c7c38;
|
126 |
-
border: 2px solid #9c7c38;
|
127 |
-
}
|
128 |
-
.stButton>button:hover {
|
129 |
-
color: #9c7c38;
|
130 |
-
background-color: #1a1a1a;
|
131 |
-
border: 2px solid #9c7c38;
|
132 |
-
}
|
133 |
-
|
134 |
-
/* Markdown headers */
|
135 |
-
h1, h2, h3 {
|
136 |
-
color: #9c7c38;
|
137 |
-
}
|
138 |
-
|
139 |
-
/* Output story container */
|
140 |
-
.story-container {
|
141 |
-
background-color: #2d2d2d;
|
142 |
-
color: #eaeaea;
|
143 |
-
padding: 20px;
|
144 |
-
border-radius: 5px;
|
145 |
-
border-left: 5px solid #9c7c38;
|
146 |
-
font-family: 'Times New Roman', Times, serif;
|
147 |
-
line-height: 1.6;
|
148 |
-
box-shadow: 0 0 10px rgba(156, 124, 56, 0.3);
|
149 |
-
}
|
150 |
-
|
151 |
-
/* Expander (prompt) */
|
152 |
-
.st-expander {
|
153 |
-
background-color: #2d2d2d;
|
154 |
-
color: #d0d0d0;
|
155 |
-
}
|
156 |
-
|
157 |
-
/* Scrollbar dark theme */
|
158 |
-
::-webkit-scrollbar {
|
159 |
-
width: 8px;
|
160 |
-
}
|
161 |
-
::-webkit-scrollbar-track {
|
162 |
-
background: #1a1a1a;
|
163 |
-
}
|
164 |
-
::-webkit-scrollbar-thumb {
|
165 |
-
background: #555;
|
166 |
-
border-radius: 4px;
|
167 |
-
}
|
168 |
-
::-webkit-scrollbar-thumb:hover {
|
169 |
-
background: #777;
|
170 |
-
}
|
171 |
-
</style>
|
172 |
-
""", unsafe_allow_html=True)
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
max_new_tokens = st.sidebar.slider("Max Tokens", 500, 4096, 2048, 100,
|
176 |
help="Maximum length of generated text")
|
|
|
92 |
|
93 |
# Add custom CSS
|
94 |
st.markdown("""
|
95 |
+
<style>
|
96 |
+
.main {
|
97 |
+
background-color: #1a1a1a;
|
98 |
+
color: #d0d0d0;
|
99 |
+
}
|
100 |
+
|
101 |
+
.stButton>button {
|
102 |
+
color: #1a1a1a;
|
103 |
+
background-color: #9c7c38;
|
104 |
+
border: 2px solid #9c7c38;
|
105 |
+
}
|
106 |
+
.stButton>button:hover {
|
107 |
+
color: #9c7c38;
|
108 |
+
background-color: #1a1a1a;
|
109 |
+
border: 2px solid #9c7c38;
|
110 |
+
}
|
111 |
+
h1, h2, h3 {
|
112 |
+
color: #9c7c38;
|
113 |
+
}
|
114 |
+
.sidebar .sidebar-content {
|
115 |
+
background-color: #1a1a1a;
|
116 |
+
}
|
117 |
+
</style>
|
118 |
+
""", unsafe_allow_html=True)
|
119 |
+
|
120 |
+
# Title
|
121 |
+
st.title("The Raven's Quill")
|
122 |
+
st.subheader("Generate Edgar Allan Poe-style Stories with AI")
|
123 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
# Set model path
|
126 |
+
model_path = "model"
|
127 |
+
|
128 |
+
# Generation parameters
|
129 |
+
# Sidebar introduction
|
130 |
+
st.sidebar.markdown("## 🪶 About This App")
|
131 |
+
st.sidebar.markdown(
|
132 |
+
"""
|
133 |
+
**The Raven's Quill** lets you generate short stories in the style of **Edgar Allan Poe**.
|
134 |
+
📝 **How to use:**
|
135 |
+
- Select the genre, atmosphere, themes, and character details
|
136 |
+
- Add special elements like ravens or unreliable narrators
|
137 |
+
- Click **Generate Poe Story** to receive your tale of terror
|
138 |
+
|
139 |
+
"""
|
140 |
+
)
|
141 |
|
142 |
max_new_tokens = st.sidebar.slider("Max Tokens", 500, 4096, 2048, 100,
|
143 |
help="Maximum length of generated text")
|