Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -55,8 +55,8 @@ def extract_info(output_text):
|
|
55 |
if match:
|
56 |
name = match.group(1)
|
57 |
quote = match.group(2)
|
58 |
-
ingredients = match.group(3)
|
59 |
-
instruction = match.group(4)
|
60 |
notes = match.group(5)
|
61 |
return name, quote, ingredients, instruction, notes
|
62 |
else:
|
@@ -65,10 +65,10 @@ def extract_info(output_text):
|
|
65 |
def format_cocktail_output(name, quote, ingredients, instruction, notes):
|
66 |
# Construct the HTML output
|
67 |
html_output = f'''
|
68 |
-
<div style="text-align: center; font-family: '
|
69 |
-
<h1 style="font-size:
|
70 |
-
<p style="font-size:
|
71 |
-
<p style="font-size:
|
72 |
<strong>Ingredients:</strong><br>
|
73 |
{ingredients}<br>
|
74 |
<strong>Instruction:</strong><br>
|
@@ -97,6 +97,8 @@ with gr.Blocks(css='''
|
|
97 |
|
98 |
with gr.Row():
|
99 |
mood = gr.Textbox(label="Mood")
|
|
|
|
|
100 |
|
101 |
with gr.Row():
|
102 |
sweetness = gr.Slider(label="Sweetness", minimum=0, maximum=10, elem_id="slider-sweetness")
|
@@ -105,9 +107,9 @@ with gr.Blocks(css='''
|
|
105 |
bitter = gr.Slider(label="Bitter", minimum=0, maximum=10, elem_id="slider-bitter")
|
106 |
soberness_level = gr.Slider(label="Level of Soberness", minimum=0, maximum=10, elem_id="slider-soberness_level")
|
107 |
|
108 |
-
with gr.Row():
|
109 |
-
|
110 |
-
|
111 |
with gr.Row():
|
112 |
allergies = gr.Textbox(label="Allergies")
|
113 |
additional_requests = gr.Textbox(label="Anything else you would like to address")
|
|
|
55 |
if match:
|
56 |
name = match.group(1)
|
57 |
quote = match.group(2)
|
58 |
+
ingredients = match.group(3).replace('\n', '<br>')
|
59 |
+
instruction = match.group(4).replace('\n', '<br>')
|
60 |
notes = match.group(5)
|
61 |
return name, quote, ingredients, instruction, notes
|
62 |
else:
|
|
|
65 |
def format_cocktail_output(name, quote, ingredients, instruction, notes):
|
66 |
# Construct the HTML output
|
67 |
html_output = f'''
|
68 |
+
<div style="text-align: center; font-family: 'American Typewriter', serif; color: white;">
|
69 |
+
<h1 style="font-size: 48px; color: white;">{name}</h1>
|
70 |
+
<p style="font-size: 36px; margin-top: -15px; font-style: italic; color: white;">{quote}</p>
|
71 |
+
<p style="font-size: 20px; color: white;">
|
72 |
<strong>Ingredients:</strong><br>
|
73 |
{ingredients}<br>
|
74 |
<strong>Instruction:</strong><br>
|
|
|
97 |
|
98 |
with gr.Row():
|
99 |
mood = gr.Textbox(label="Mood")
|
100 |
+
flavor_association = gr.CheckboxGroup(label="Flavor Association", choices=["Fruity", "Herbal", "Spicy", "Floral", "Nutty", "Woody", "Earthy"])
|
101 |
+
drinking_experience = gr.CheckboxGroup(label="Drinking Experience", choices=["Refreshing", "Warming", "Comforting", "Energizing", "Relaxing"])
|
102 |
|
103 |
with gr.Row():
|
104 |
sweetness = gr.Slider(label="Sweetness", minimum=0, maximum=10, elem_id="slider-sweetness")
|
|
|
107 |
bitter = gr.Slider(label="Bitter", minimum=0, maximum=10, elem_id="slider-bitter")
|
108 |
soberness_level = gr.Slider(label="Level of Soberness", minimum=0, maximum=10, elem_id="slider-soberness_level")
|
109 |
|
110 |
+
# with gr.Row():
|
111 |
+
# flavor_association = gr.CheckboxGroup(label="Flavor Association", choices=["Fruity", "Herbal", "Spicy", "Floral", "Nutty", "Woody", "Earthy"])
|
112 |
+
# drinking_experience = gr.CheckboxGroup(label="Drinking Experience", choices=["Refreshing", "Warming", "Comforting", "Energizing", "Relaxing"])
|
113 |
with gr.Row():
|
114 |
allergies = gr.Textbox(label="Allergies")
|
115 |
additional_requests = gr.Textbox(label="Anything else you would like to address")
|