Spaces:
Sleeping
Sleeping
Feat: Added logic for random prompts
Browse files
app.py
CHANGED
@@ -25,16 +25,11 @@ def folder_exists(folder_path):
|
|
25 |
return False
|
26 |
|
27 |
|
28 |
-
def
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
random_key = choice(keys)
|
34 |
-
random_value = choice(user_requests_dict[random_key])
|
35 |
-
result_list.append([random_key, random_value])
|
36 |
-
|
37 |
-
return result_list
|
38 |
|
39 |
def generate_html_table(random_requests):
|
40 |
# Start building the HTML table
|
@@ -123,7 +118,7 @@ if app_mode == "Generate Recomendations":
|
|
123 |
|
124 |
st.subheader("Examples")
|
125 |
with st.container():
|
126 |
-
examples =
|
127 |
html_table = generate_html_table(examples)
|
128 |
st.write(html_table, unsafe_allow_html=True)
|
129 |
st.divider()
|
|
|
25 |
return False
|
26 |
|
27 |
|
28 |
+
def get_random_prompts(examples):
|
29 |
+
random_examples = []
|
30 |
+
for k in examples.keys():
|
31 |
+
random_examples.append([k, choice(examples[k])])
|
32 |
+
return random_examples
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
def generate_html_table(random_requests):
|
35 |
# Start building the HTML table
|
|
|
118 |
|
119 |
st.subheader("Examples")
|
120 |
with st.container():
|
121 |
+
examples = get_random_prompts(user_requests_tests)
|
122 |
html_table = generate_html_table(examples)
|
123 |
st.write(html_table, unsafe_allow_html=True)
|
124 |
st.divider()
|