sander-wood commited on
Commit
87c000d
1 Parent(s): a86e986

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +65 -2
app.py CHANGED
@@ -6,6 +6,68 @@ from utils import *
6
  from unidecode import unidecode
7
  from transformers import AutoTokenizer
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  CLAMP_MODEL_NAME = 'clamp-small-512'
10
  QUERY_MODAL = 'text'
11
  KEY_MODAL = 'music'
@@ -153,5 +215,6 @@ gr.Interface(
153
  fn=semantic_music_search,
154
  inputs=gr.Textbox(lines=2, placeholder="Describe the music you want to search..."),
155
  outputs=[output_title, output_artist, output_genre, output_description, output_abc],
156
- title="Semantic Music Search",
157
- description="Search for music based on your description").launch()
 
 
6
  from unidecode import unidecode
7
  from transformers import AutoTokenizer
8
 
9
+ description = """
10
+ <div>
11
+ <a style="display:inline-block" href='https://github.com/suno-ai/bark'><img src='https://img.shields.io/github/stars/suno-ai/bark?style=social' /></a>
12
+ <a style='display:inline-block' href='https://discord.gg/J2B2vsjKuE'><img src='https://dcbadge.vercel.app/api/server/J2B2vsjKuE?compact=true&style=flat' /></a>
13
+ <a style="display:inline-block; margin-left: 1em" href="https://huggingface.co/spaces/suno/bark?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space%20to%20skip%20the%20queue-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a>
14
+ </div>
15
+ Bark is a universal text-to-audio model created by [Suno](www.suno.ai), with code publicly available [here](https://github.com/suno-ai/bark). \
16
+ Bark can generate highly realistic, multilingual speech as well as other audio - including music, background noise and simple sound effects. \
17
+ This demo should be used for research purposes only. Commercial use is strictly prohibited. \
18
+ The model output is not censored and the authors do not endorse the opinions in the generated content. \
19
+ Use at your own risk.
20
+ """
21
+
22
+ article = """
23
+ ## 🌎 Foreign Language
24
+ Bark supports various languages out-of-the-box and automatically determines language from input text. \
25
+ When prompted with code-switched text, Bark will even attempt to employ the native accent for the respective languages in the same voice.
26
+ Try the prompt:
27
+ ```
28
+ Buenos días Miguel. Tu colega piensa que tu alemán es extremadamente malo. But I suppose your english isn't terrible.
29
+ ```
30
+ ## 🤭 Non-Speech Sounds
31
+ Below is a list of some known non-speech sounds, but we are finding more every day. \
32
+ Please let us know if you find patterns that work particularly well on Discord!
33
+ * [laughter]
34
+ * [laughs]
35
+ * [sighs]
36
+ * [music]
37
+ * [gasps]
38
+ * [clears throat]
39
+ * — or ... for hesitations
40
+ * ♪ for song lyrics
41
+ * capitalization for emphasis of a word
42
+ * MAN/WOMAN: for bias towards speaker
43
+ Try the prompt:
44
+ ```
45
+ " [clears throat] Hello, my name is Suno. And, uh — and I like pizza. [laughs] But I also have other interests such as... ♪ singing ♪."
46
+ ```
47
+ ## 🎶 Music
48
+ Bark can generate all types of audio, and, in principle, doesn't see a difference between speech and music. \
49
+ Sometimes Bark chooses to generate text as music, but you can help it out by adding music notes around your lyrics.
50
+ Try the prompt:
51
+ ```
52
+ ♪ In the jungle, the mighty jungle, the lion barks tonight ♪
53
+ ```
54
+ ## 🧬 Voice Cloning
55
+ Bark has the capability to fully clone voices - including tone, pitch, emotion and prosody. \
56
+ The model also attempts to preserve music, ambient noise, etc. from input audio. \
57
+ However, to mitigate misuse of this technology, we limit the audio history prompts to a limited set of Suno-provided, fully synthetic options to choose from.
58
+ ## 👥 Speaker Prompts
59
+ You can provide certain speaker prompts such as NARRATOR, MAN, WOMAN, etc. \
60
+ Please note that these are not always respected, especially if a conflicting audio history prompt is given.
61
+ Try the prompt:
62
+ ```
63
+ WOMAN: I would like an oatmilk latte please.
64
+ MAN: Wow, that's expensive!
65
+ ```
66
+ ## Details
67
+ Bark model by [Suno](https://suno.ai/), including official [code](https://github.com/suno-ai/bark) and model weights. \
68
+ Gradio demo supported by 🤗 Hugging Face. Bark is licensed under a non-commercial license: CC-BY 4.0 NC, see details on [GitHub](https://github.com/suno-ai/bark).
69
+ """
70
+
71
  CLAMP_MODEL_NAME = 'clamp-small-512'
72
  QUERY_MODAL = 'text'
73
  KEY_MODAL = 'music'
 
215
  fn=semantic_music_search,
216
  inputs=gr.Textbox(lines=2, placeholder="Describe the music you want to search..."),
217
  outputs=[output_title, output_artist, output_genre, output_description, output_abc],
218
+ title="🗜️ CLaMP: Semantic Music Search",
219
+ description=description,
220
+ article=article).launch()