erhanmeydan commited on
Commit
ac22e8a
·
verified ·
1 Parent(s): f39f253

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # NotaGen modelini yükle
5
+ generator = pipeline('text-generation', model='ElectricAlexis/NotaGen-large')
6
+
7
+ # Müzik üretme fonksiyonu
8
+ def generate_music(prompt):
9
+ output = generator(prompt, max_length=100, num_return_sequences=1)
10
+ return output[0]['generated_text']
11
+
12
+ # Gradio arayüzü oluştur
13
+ interface = gr.Interface(
14
+ fn=generate_music,
15
+ inputs="text",
16
+ outputs="text",
17
+ title="NotaGen ile Müzik Oluşturma",
18
+ description="Bir müzik tarzı girin (örneğin, 'Barok piyano parçası') ve notaları üretin!"
19
+ )
20
+
21
+ # Arayüzü başlat
22
+ interface.launch()