yiqing111 commited on
Commit
d09c16d
·
verified ·
1 Parent(s): be80898

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -78
app.py CHANGED
@@ -92,85 +92,52 @@ def main():
92
 
93
  # Add custom CSS
94
  st.markdown("""
95
- <style>
96
- body, .main, .block-container {
97
- background-color: #1a1a1a;
98
- color: #d0d0d0;
99
- }
100
-
101
- /* Sidebar dark theme */
102
- [data-testid="stSidebar"] {
103
- background-color: #121212;
104
- color: #d0d0d0;
105
- }
106
- [data-testid="stSidebar"] .stMarkdown {
107
- color: #d0d0d0;
108
- }
109
-
110
- /* Input boxes */
111
- input, textarea, .stTextInput > div > div > input {
112
- background-color: #2d2d2d !important;
113
- color: #f0f0f0 !important;
114
- border: 1px solid #555 !important;
115
- }
116
- .stTextArea textarea {
117
- background-color: #2d2d2d !important;
118
- color: #f0f0f0 !important;
119
- border: 1px solid #555 !important;
120
- }
121
-
122
- /* Button styles */
123
- .stButton>button {
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")