Spaces:
Running
Running
Reduce input size and track submit button state
Browse files- app.py +4 -0
- global_config.py +1 -1
- strings.json +1 -1
app.py
CHANGED
@@ -144,6 +144,10 @@ def build_ui():
|
|
144 |
|
145 |
if submit:
|
146 |
# st.write(f'Clicked {time.time()}')
|
|
|
|
|
|
|
|
|
147 |
progress_text = 'Generating the slides...give it a moment'
|
148 |
progress_bar = st.progress(0, text=progress_text)
|
149 |
|
|
|
144 |
|
145 |
if submit:
|
146 |
# st.write(f'Clicked {time.time()}')
|
147 |
+
st.session_state.submitted = True
|
148 |
+
|
149 |
+
# https://github.com/streamlit/streamlit/issues/3832#issuecomment-1138994421
|
150 |
+
if 'submitted' in st.session_state:
|
151 |
progress_text = 'Generating the slides...give it a moment'
|
152 |
progress_bar = st.progress(0, text=progress_text)
|
153 |
|
global_config.py
CHANGED
@@ -25,7 +25,7 @@ class GlobalConfig:
|
|
25 |
# LLM_MODEL_TEMPERATURE: float = 0.5
|
26 |
LLM_MODEL_MIN_OUTPUT_LENGTH: int = 50
|
27 |
LLM_MODEL_MAX_OUTPUT_LENGTH: int = 2000
|
28 |
-
LLM_MODEL_MAX_INPUT_LENGTH: int =
|
29 |
|
30 |
METAPHOR_API_KEY = os.environ.get('METAPHOR_API_KEY', '')
|
31 |
|
|
|
25 |
# LLM_MODEL_TEMPERATURE: float = 0.5
|
26 |
LLM_MODEL_MIN_OUTPUT_LENGTH: int = 50
|
27 |
LLM_MODEL_MAX_OUTPUT_LENGTH: int = 2000
|
28 |
+
LLM_MODEL_MAX_INPUT_LENGTH: int = 300
|
29 |
|
30 |
METAPHOR_API_KEY = os.environ.get('METAPHOR_API_KEY', '')
|
31 |
|
strings.json
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
"Since you have come this far, we have unlocked some more good stuff for you!"
|
15 |
],
|
16 |
"input_labels": [
|
17 |
-
"**Describe the topic of the presentation using 10 to
|
18 |
],
|
19 |
"button_labels": [
|
20 |
"Generate contents",
|
|
|
14 |
"Since you have come this far, we have unlocked some more good stuff for you!"
|
15 |
],
|
16 |
"input_labels": [
|
17 |
+
"**Describe the topic of the presentation using 10 to 300 characters. Avoid mentioning the count of slides.**"
|
18 |
],
|
19 |
"button_labels": [
|
20 |
"Generate contents",
|