Oleh Kuznetsov commited on
Commit
4825b08
·
1 Parent(s): bdaca7e

feat(rec): Improve fonts, add accordion with instructions

Browse files
Files changed (3) hide show
  1. app.py +7 -3
  2. resources/description.md +5 -25
  3. resources/instructions.md +27 -0
app.py CHANGED
@@ -165,7 +165,7 @@ gemini_config = types.GenerateContentConfig(
165
  system_instruction=(
166
  "You are a helpful music genre recommendation assistant built into"
167
  " music genre search engine, helping users discover novel music genres."
168
- )
169
  )
170
  gemini_llm = genai.Client(
171
  api_key=GEMINI_API_KEY,
@@ -438,9 +438,13 @@ def reset_ui():
438
 
439
 
440
  app_description = load_text_resource(Path("./resources/description.md"))
441
-
442
- with gr.Blocks(title="SADAIMREC") as demo:
 
 
443
  gr.Markdown(app_description)
 
 
444
  query = gr.Textbox(
445
  label="Your Query",
446
  placeholder="Calming, music for deep relaxation with echoing sounds and deep bass",
 
165
  system_instruction=(
166
  "You are a helpful music genre recommendation assistant built into"
167
  " music genre search engine, helping users discover novel music genres."
168
+ ),
169
  )
170
  gemini_llm = genai.Client(
171
  api_key=GEMINI_API_KEY,
 
438
 
439
 
440
  app_description = load_text_resource(Path("./resources/description.md"))
441
+ app_instructions = load_text_resource(Path("./resources/instructions.md"))
442
+ with gr.Blocks(
443
+ title="sadai-mrec", theme=gr.themes.Default(text_size=gr.themes.sizes.text_lg)
444
+ ) as demo:
445
  gr.Markdown(app_description)
446
+ with gr.Accordion("Detailed usage instructions", open=False):
447
+ gr.Markdown(app_instructions)
448
  query = gr.Textbox(
449
  label="Your Query",
450
  placeholder="Calming, music for deep relaxation with echoing sounds and deep bass",
resources/description.md CHANGED
@@ -2,32 +2,12 @@
2
 
3
  This simple application was developed and deployed as **complementary material for my thesis**.
4
 
5
- In case of any complications, questions or suggestions, please reach out via [email](mailto:sadaisystems@pm.me).
6
-
7
- ## Instructions
8
 
9
- 1. Formulate a **search query** with description of a music genre you would like to listen to. Expected format is described below.
10
- 2. Explore **two generated recommendation rankings**: one is created by my system, one is generated using `gemini-2.0-flash`. Order is **randomized** each run.
11
- 3. Determine which ranking you prefer more.
12
- 4. Vote for your choice.
13
- 5. Wait for refresh and repeat as many times as you want.
14
 
15
- ## Expected Query Format
16
 
17
- - The system was designed to support **3 categories** of music genre descriptors:
18
- - **Subjective**: Emotional & perceptual qualities, desired **inner feeling** (melancholic, energetic)
19
- - **Purpose-Based**: Listening setting, context, suitable activities, scenario (party, workout)
20
- - **Technical**: Musical & production attributes, **HOW the sound is made** (instrumentation, timbre, tempo, lo-fi)
21
- - **Other descriptors are out of scope of the current implementation**:
22
- - I kindly ask you to only use the above 3 categories for your queries
23
- - Usage of cultural, historical, etc. descriptors can lead to suboptimal results
24
- - You can make the descriptors **as complex and poetic as you want**, but I kindly ask you to **limit your query to a couple of sentences**
25
 
26
- ## Query Examples
27
-
28
- - `Music for deep relaxation with echoing sounds and heavy bass, perfect for unwinding after along day`
29
- - `Music that feels like the echo of a forgotten world—slow, sorrowful. Guitars and distant vocals create the sensation of a long, drifting sleep on the edge of melancholy and oblivion.A soundtrack to isolation, it slowly pulls you into the depths of existential despair.`
30
- - `Raw and filled with aggression, high-energy drums, mosh-pit vibes, high bpm, guitars`
31
- - `Music to study to, relaxing, chill with calm drums, some piano, and suitable for background`
32
- - `Creamy and cozy, suitable for evenings with loved ones`
33
- - `Dreamy instrumental music for midnight melancholia`
 
2
 
3
  This simple application was developed and deployed as **complementary material for my thesis**.
4
 
5
+ The system generates music genre recommendations based on your textual search query.
 
 
6
 
7
+ **Goal**: collect some **real-world human evaluations**, using **blind side-by-side comparison** of recommendations with a proprietary model.
 
 
 
 
8
 
9
+ **Click on accordion down below for detailed instructions.**
10
 
11
+ **Have fun!**
 
 
 
 
 
 
 
12
 
13
+ In case of any complications, questions or suggestions, please reach out via [email](mailto:[email protected]).
 
 
 
 
 
 
 
resources/instructions.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Instructions
2
+
3
+ 1. Formulate a **search query** with description of a music genre you would like to listen to. Expected format is described below.
4
+ 2. Explore **two generated recommendation rankings**: one is created by my system, one is generated using `gemini-2.0-flash`. Order is **randomized** each run.
5
+ 3. Determine which ranking you prefer more.
6
+ 4. Vote for your choice.
7
+ 5. Wait for refresh and repeat as many times as you want.
8
+
9
+ ## Expected Query Format
10
+
11
+ - The system was designed to support **3 categories** of music genre descriptors:
12
+ - **Subjective**: Emotional & perceptual qualities, desired **inner feeling** (melancholic, energetic)
13
+ - **Purpose-Based**: Listening setting, context, suitable activities, scenario (party, workout)
14
+ - **Technical**: Musical & production attributes, **HOW the sound is made** (instrumentation, timbre, tempo, lo-fi)
15
+ - **Other descriptors are out of scope of the current implementation**:
16
+ - I kindly ask you to only use the above 3 categories for your queries
17
+ - Usage of cultural, historical, etc. descriptors can lead to suboptimal results
18
+ - You can make the descriptors **as complex and poetic as you want**, but I kindly ask you to **limit your query to a couple of sentences**
19
+
20
+ ## Query Examples
21
+
22
+ - `Music for deep relaxation with echoing sounds and heavy bass, perfect for unwinding after along day`
23
+ - `Music that feels like the echo of a forgotten world—slow, sorrowful. Guitars and distant vocals create the sensation of a long, drifting sleep on the edge of melancholy and oblivion.A soundtrack to isolation, it slowly pulls you into the depths of existential despair.`
24
+ - `Raw and filled with aggression, high-energy drums, mosh-pit vibes, high bpm, guitars`
25
+ - `Music to study to, relaxing, chill with calm drums, some piano, and suitable for background`
26
+ - `Creamy and cozy, suitable for evenings with loved ones`
27
+ - `Dreamy instrumental music for midnight melancholia`