shawarmabytes commited on
Commit
6f7c56d
1 Parent(s): 24011cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -12,13 +12,14 @@ def tester(text):
12
  if (results[0]['label']=="joy"): #songs for joy emotion
13
  with open('joyplaylist.txt') as f:
14
  contents = f.read()
15
- components.html(contents,width=560,height=325)
 
16
 
17
  elif (results[0]['label']=="anger"): #songs for anger emotion
18
  with open('angryplaylist.txt') as f:
19
  contents = f.read()
20
  components.html(contents,width=560,height=325)
21
-
22
  elif (results[0]['label']=="disgust"):
23
  st_player("https://www.youtube.com/watch?v=zWq2TT3ieGE")
24
 
@@ -26,12 +27,12 @@ def tester(text):
26
  with open('fearplaylist.txt') as f:
27
  contents = f.read()
28
  components.html(contents,width=560,height=325)
29
-
30
  elif (results[0]['label']=="sadness"): #songs for sadness emotion
31
  with open('sadplaylist.txt') as f:
32
  contents = f.read()
33
  components.html(contents,width=560,height=325)
34
-
35
  elif (results[0]['label']=="surprise"):
36
  st.write("gulat ka noh")
37
 
@@ -39,7 +40,7 @@ def tester(text):
39
  with open('loveplaylist.txt') as f:
40
  contents = f.read()
41
  components.html(contents,width=560,height=325)
42
-
43
  return results[0]['label']
44
 
45
 
 
12
  if (results[0]['label']=="joy"): #songs for joy emotion
13
  with open('joyplaylist.txt') as f:
14
  contents = f.read()
15
+ components.html(contents,width=560,height=325)
16
+ contents.close()
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
+ contents.close()
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
+ contents.close()
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
+ contents.close()
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
+ contents.close()
44
  return results[0]['label']
45
 
46