shawarmabytes commited on
Commit
93a9008
1 Parent(s): 5d2626c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -14,13 +14,12 @@ def tester(text):
14
  with open('joyplaylist.txt') as f:
15
  contents = f.read()
16
  components.html(contents,width=560,height=325)
17
- contents.close()
18
 
19
  elif (results[0]['label']=="anger"): #songs for anger emotion
20
  with open('angryplaylist.txt') as f:
21
  contents = f.read()
22
  components.html(contents,width=560,height=325)
23
- contents.close()
24
  elif (results[0]['label']=="disgust"):
25
  st_player("https://www.youtube.com/watch?v=zWq2TT3ieGE")
26
 
@@ -28,12 +27,12 @@ def tester(text):
28
  with open('fearplaylist.txt') as f:
29
  contents = f.read()
30
  components.html(contents,width=560,height=325)
31
- contents.close()
32
  elif (results[0]['label']=="sadness"): #songs for sadness emotion
33
  with open('sadplaylist.txt') as f:
34
  contents = f.read()
35
  components.html(contents,width=560,height=325)
36
- contents.close()
37
  elif (results[0]['label']=="surprise"):
38
  st.write("gulat ka noh")
39
 
@@ -41,17 +40,11 @@ def tester(text):
41
  with open('loveplaylist.txt') as f:
42
  contents = f.read()
43
  components.html(contents,width=560,height=325)
44
- contents.close()
45
-
46
-
47
-
48
-
49
 
50
 
51
  st.header("stream your emotions")
52
 
53
 
54
- #st.write("Enter a text/phrase/sentence. A corresponding song will be recommended based on its emotion")
55
  emo = st.text_input("Enter a text/phrase/sentence. A corresponding song will be recommended based on its emotion.")
56
  st.write("Examples: i love you so much")
57
  st.write("I am exhausted.")
 
14
  with open('joyplaylist.txt') as f:
15
  contents = f.read()
16
  components.html(contents,width=560,height=325)
 
17
 
18
  elif (results[0]['label']=="anger"): #songs for anger emotion
19
  with open('angryplaylist.txt') as f:
20
  contents = f.read()
21
  components.html(contents,width=560,height=325)
22
+
23
  elif (results[0]['label']=="disgust"):
24
  st_player("https://www.youtube.com/watch?v=zWq2TT3ieGE")
25
 
 
27
  with open('fearplaylist.txt') as f:
28
  contents = f.read()
29
  components.html(contents,width=560,height=325)
30
+
31
  elif (results[0]['label']=="sadness"): #songs for sadness emotion
32
  with open('sadplaylist.txt') as f:
33
  contents = f.read()
34
  components.html(contents,width=560,height=325)
35
+
36
  elif (results[0]['label']=="surprise"):
37
  st.write("gulat ka noh")
38
 
 
40
  with open('loveplaylist.txt') as f:
41
  contents = f.read()
42
  components.html(contents,width=560,height=325)
 
 
 
 
 
43
 
44
 
45
  st.header("stream your emotions")
46
 
47
 
 
48
  emo = st.text_input("Enter a text/phrase/sentence. A corresponding song will be recommended based on its emotion.")
49
  st.write("Examples: i love you so much")
50
  st.write("I am exhausted.")