tywei08 commited on
Commit
ad3f02e
·
verified ·
1 Parent(s): eb18f40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ def generate_cocktail(mood, sweetness, sour, savory, bitter, flavor_association,
32
  client = openai.OpenAI(api_key=os.environ["API_TOKEN"])
33
  instruction = "Please provide a cocktail recipe given the mood and preference of the user.\n\n"
34
  user_prompt = f"Mood: {mood}\nTaste: Sweetness {sweetness}/10, Sour {sour}/10, Savory {savory}/10, Bitter {bitter}/10\nFlavor Association: {flavor_association}\nDrinking Experience: {drinking_experience}\nLevel of Soberness: {soberness_level}\nAllergies: {allergies}\nAdditional Requests: {additional_requests}\n\nMake sure to avoid all allergic ingredients.\n\n"
35
- output_format = "Please strictly follow this output format:\n\nCocktail Name:[name]\nQuote:[one sentence quote related to the cocktail and the mood description]\nIngredients:\n[ingredient 1]\n[ingredient 2]\n...\nInstruction:\n1. [step 1]\n2. [step 2]\n...\nNotes:[notes]"
36
  prompt = instruction + user_prompt + output_format
37
 
38
  messages=[
@@ -65,7 +65,7 @@ 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: 'Apple Chancery', cursive; 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;">
@@ -90,7 +90,7 @@ with gr.Blocks(css='''
90
  }
91
  .generate-button {
92
  background: linear-gradient(to right, #F0E68C, #E0FFFF, #FF6347);
93
- color: white;
94
  padding: 10px 20px;
95
  border: none;
96
  border-radius: 5px;
 
32
  client = openai.OpenAI(api_key=os.environ["API_TOKEN"])
33
  instruction = "Please provide a cocktail recipe given the mood and preference of the user.\n\n"
34
  user_prompt = f"Mood: {mood}\nTaste: Sweetness {sweetness}/10, Sour {sour}/10, Savory {savory}/10, Bitter {bitter}/10\nFlavor Association: {flavor_association}\nDrinking Experience: {drinking_experience}\nLevel of Soberness: {soberness_level}\nAllergies: {allergies}\nAdditional Requests: {additional_requests}\n\nMake sure to avoid all allergic ingredients.\n\n"
35
+ output_format = "Please strictly follow this output format:\n\nCocktail Name:[name]\nQuote:[one sentence quote related to the cocktail and the mood description]\nIngredients:[ingredient 1]\n[ingredient 2]\n...\nInstruction:1. [step 1]\n2. [step 2]\n...\nNotes:[notes]"
36
  prompt = instruction + user_prompt + output_format
37
 
38
  messages=[
 
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: 'Verdana', sans-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;">
 
90
  }
91
  .generate-button {
92
  background: linear-gradient(to right, #F0E68C, #E0FFFF, #FF6347);
93
+ color: black;
94
  padding: 10px 20px;
95
  border: none;
96
  border-radius: 5px;