Spaces:
Running
Running
Add a slide with icons
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- app.py +30 -2
- bootstrap-icons-1.11.3/png128/0-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/1-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/123.png +0 -0
- bootstrap-icons-1.11.3/png128/2-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/3-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/4-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/5-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/6-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/7-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/8-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/9-circle.png +0 -0
- bootstrap-icons-1.11.3/png128/activity.png +0 -0
- bootstrap-icons-1.11.3/png128/airplane.png +0 -0
- bootstrap-icons-1.11.3/png128/alarm.png +0 -0
- bootstrap-icons-1.11.3/png128/alphabet.png +0 -0
- bootstrap-icons-1.11.3/png128/amazon.png +0 -0
- bootstrap-icons-1.11.3/png128/android2.png +0 -0
- bootstrap-icons-1.11.3/png128/apple.png +0 -0
- bootstrap-icons-1.11.3/png128/archive.png +0 -0
- bootstrap-icons-1.11.3/png128/award-fill.png +0 -0
- bootstrap-icons-1.11.3/png128/award.png +0 -0
- bootstrap-icons-1.11.3/png128/balloon.png +0 -0
- bootstrap-icons-1.11.3/png128/ban.png +0 -0
- bootstrap-icons-1.11.3/png128/bandaid.png +0 -0
- bootstrap-icons-1.11.3/png128/bank.png +0 -0
- bootstrap-icons-1.11.3/png128/bank2.png +0 -0
- bootstrap-icons-1.11.3/png128/bar-chart-line.png +0 -0
- bootstrap-icons-1.11.3/png128/basket.png +0 -0
- bootstrap-icons-1.11.3/png128/battery-charging.png +0 -0
- bootstrap-icons-1.11.3/png128/bell-slash.png +0 -0
- bootstrap-icons-1.11.3/png128/bell.png +0 -0
- bootstrap-icons-1.11.3/png128/bicycle.png +0 -0
- bootstrap-icons-1.11.3/png128/bing.png +0 -0
- bootstrap-icons-1.11.3/png128/binoculars.png +0 -0
- bootstrap-icons-1.11.3/png128/bluetooth.png +0 -0
- bootstrap-icons-1.11.3/png128/book.png +0 -0
- bootstrap-icons-1.11.3/png128/bookmark.png +0 -0
- bootstrap-icons-1.11.3/png128/bootstrap.png +0 -0
- bootstrap-icons-1.11.3/png128/briefcase.png +0 -0
- bootstrap-icons-1.11.3/png128/broadcast-pin.png +0 -0
- bootstrap-icons-1.11.3/png128/browser-chrome.png +0 -0
- bootstrap-icons-1.11.3/png128/browser-edge.png +0 -0
- bootstrap-icons-1.11.3/png128/browser-firefox.png +0 -0
- bootstrap-icons-1.11.3/png128/browser-safari.png +0 -0
- bootstrap-icons-1.11.3/png128/brush.png +0 -0
- bootstrap-icons-1.11.3/png128/bucket.png +0 -0
- bootstrap-icons-1.11.3/png128/bug-fill.png +0 -0
- bootstrap-icons-1.11.3/png128/bug.png +0 -0
- bootstrap-icons-1.11.3/png128/building.png +0 -0
app.py
CHANGED
@@ -3,6 +3,7 @@ Streamlit app containing the UI and the application logic.
|
|
3 |
"""
|
4 |
import datetime
|
5 |
import logging
|
|
|
6 |
import pathlib
|
7 |
import random
|
8 |
import tempfile
|
@@ -50,9 +51,31 @@ def _get_prompt_template(is_refinement: bool) -> str:
|
|
50 |
|
51 |
@st.cache_resource
|
52 |
def _get_llm():
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
return llm_helper.get_hf_endpoint()
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
APP_TEXT = _load_strings()
|
57 |
|
58 |
# Session variables
|
@@ -169,13 +192,15 @@ def set_up_chat_ui():
|
|
169 |
formatted_template = prompt_template.format(
|
170 |
**{
|
171 |
'instructions': list_of_msgs,
|
172 |
-
'previous_content': _get_last_response()
|
|
|
173 |
}
|
174 |
)
|
175 |
else:
|
176 |
formatted_template = prompt_template.format(
|
177 |
**{
|
178 |
'question': prompt,
|
|
|
179 |
}
|
180 |
)
|
181 |
|
@@ -204,7 +229,10 @@ def set_up_chat_ui():
|
|
204 |
logger.debug('Cleaned JSON: %s', response_cleaned)
|
205 |
|
206 |
# Now create the PPT file
|
207 |
-
progress_bar.progress(
|
|
|
|
|
|
|
208 |
path = generate_slide_deck(response_cleaned)
|
209 |
progress_bar.progress(1.0, text='Done!')
|
210 |
|
|
|
3 |
"""
|
4 |
import datetime
|
5 |
import logging
|
6 |
+
import os
|
7 |
import pathlib
|
8 |
import random
|
9 |
import tempfile
|
|
|
51 |
|
52 |
@st.cache_resource
|
53 |
def _get_llm():
|
54 |
+
"""
|
55 |
+
Get an LLM instance.
|
56 |
+
|
57 |
+
:return: The LLM.
|
58 |
+
"""
|
59 |
+
|
60 |
return llm_helper.get_hf_endpoint()
|
61 |
|
62 |
|
63 |
+
@st.cache_data
|
64 |
+
def _get_icons_list() -> List[str]:
|
65 |
+
"""
|
66 |
+
Get a list of available icons names without the dir name and file extension.
|
67 |
+
|
68 |
+
:return: A llist of the icons.
|
69 |
+
"""
|
70 |
+
|
71 |
+
items = pathlib.Path(GlobalConfig.ICONS_DIR).glob('*.png')
|
72 |
+
items = [
|
73 |
+
os.path.basename(str(item)).removesuffix('.png') for item in items
|
74 |
+
]
|
75 |
+
|
76 |
+
return items
|
77 |
+
|
78 |
+
|
79 |
APP_TEXT = _load_strings()
|
80 |
|
81 |
# Session variables
|
|
|
192 |
formatted_template = prompt_template.format(
|
193 |
**{
|
194 |
'instructions': list_of_msgs,
|
195 |
+
'previous_content': _get_last_response(),
|
196 |
+
'icons_list': '\n'.join(_get_icons_list())
|
197 |
}
|
198 |
)
|
199 |
else:
|
200 |
formatted_template = prompt_template.format(
|
201 |
**{
|
202 |
'question': prompt,
|
203 |
+
'icons_list': '\n'.join(_get_icons_list())
|
204 |
}
|
205 |
)
|
206 |
|
|
|
229 |
logger.debug('Cleaned JSON: %s', response_cleaned)
|
230 |
|
231 |
# Now create the PPT file
|
232 |
+
progress_bar.progress(
|
233 |
+
GlobalConfig.LLM_PROGRESS_MAX,
|
234 |
+
text='Finding photos online and generating the slide deck...'
|
235 |
+
)
|
236 |
path = generate_slide_deck(response_cleaned)
|
237 |
progress_bar.progress(1.0, text='Done!')
|
238 |
|
bootstrap-icons-1.11.3/png128/0-circle.png
ADDED
bootstrap-icons-1.11.3/png128/1-circle.png
ADDED
bootstrap-icons-1.11.3/png128/123.png
ADDED
bootstrap-icons-1.11.3/png128/2-circle.png
ADDED
bootstrap-icons-1.11.3/png128/3-circle.png
ADDED
bootstrap-icons-1.11.3/png128/4-circle.png
ADDED
bootstrap-icons-1.11.3/png128/5-circle.png
ADDED
bootstrap-icons-1.11.3/png128/6-circle.png
ADDED
bootstrap-icons-1.11.3/png128/7-circle.png
ADDED
bootstrap-icons-1.11.3/png128/8-circle.png
ADDED
bootstrap-icons-1.11.3/png128/9-circle.png
ADDED
bootstrap-icons-1.11.3/png128/activity.png
ADDED
bootstrap-icons-1.11.3/png128/airplane.png
ADDED
bootstrap-icons-1.11.3/png128/alarm.png
ADDED
bootstrap-icons-1.11.3/png128/alphabet.png
ADDED
bootstrap-icons-1.11.3/png128/amazon.png
ADDED
bootstrap-icons-1.11.3/png128/android2.png
ADDED
bootstrap-icons-1.11.3/png128/apple.png
ADDED
bootstrap-icons-1.11.3/png128/archive.png
ADDED
bootstrap-icons-1.11.3/png128/award-fill.png
ADDED
bootstrap-icons-1.11.3/png128/award.png
ADDED
bootstrap-icons-1.11.3/png128/balloon.png
ADDED
bootstrap-icons-1.11.3/png128/ban.png
ADDED
bootstrap-icons-1.11.3/png128/bandaid.png
ADDED
bootstrap-icons-1.11.3/png128/bank.png
ADDED
bootstrap-icons-1.11.3/png128/bank2.png
ADDED
bootstrap-icons-1.11.3/png128/bar-chart-line.png
ADDED
bootstrap-icons-1.11.3/png128/basket.png
ADDED
bootstrap-icons-1.11.3/png128/battery-charging.png
ADDED
bootstrap-icons-1.11.3/png128/bell-slash.png
ADDED
bootstrap-icons-1.11.3/png128/bell.png
ADDED
bootstrap-icons-1.11.3/png128/bicycle.png
ADDED
bootstrap-icons-1.11.3/png128/bing.png
ADDED
bootstrap-icons-1.11.3/png128/binoculars.png
ADDED
bootstrap-icons-1.11.3/png128/bluetooth.png
ADDED
bootstrap-icons-1.11.3/png128/book.png
ADDED
bootstrap-icons-1.11.3/png128/bookmark.png
ADDED
bootstrap-icons-1.11.3/png128/bootstrap.png
ADDED
bootstrap-icons-1.11.3/png128/briefcase.png
ADDED
bootstrap-icons-1.11.3/png128/broadcast-pin.png
ADDED
bootstrap-icons-1.11.3/png128/browser-chrome.png
ADDED
bootstrap-icons-1.11.3/png128/browser-edge.png
ADDED
bootstrap-icons-1.11.3/png128/browser-firefox.png
ADDED
bootstrap-icons-1.11.3/png128/browser-safari.png
ADDED
bootstrap-icons-1.11.3/png128/brush.png
ADDED
bootstrap-icons-1.11.3/png128/bucket.png
ADDED
bootstrap-icons-1.11.3/png128/bug-fill.png
ADDED
bootstrap-icons-1.11.3/png128/bug.png
ADDED
bootstrap-icons-1.11.3/png128/building.png
ADDED