oturk commited on
Commit
5fb3d7c
·
1 Parent(s): fd69c03

Add rime user

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -51,7 +51,6 @@ SCHEDULE_ME = [
51
  "You're very welcome. I've got everything updated, so we'll see you on the twenty fourth for your rescheduled haircut appointment with Helen at two p. m., including the deep conditioning treatment. Anything else I can help with today?",
52
  "Thanks for calling, have a great rest of your day!",
53
  ]
54
-
55
  SUPERSIZED = [
56
  "Good morning and welcome to Domino's. This is James.",
57
  "Are you calling to place a new order?",
@@ -502,11 +501,14 @@ ASURION_TEXTS = SCHEDULE_ME + SUPERSIZED
502
  GOODCALL_TEXTS = SCHEDULE_ME
503
  CONVERSENEW_TEXTS = SUPERSIZED
504
  YLOPO_TEXTS = MONOPOLY
 
 
505
  ivr_sid_to_name = {423: 'whirlpool', 836: 'sunrise', 2653: 'butterfly', 2654: 'rainfall', 2655: 'canyon', 2656: 'jungle', 2657: 'hills', 2658: 'lake', 3525: 'wildflower', 3529: 'peak', 3535: 'river', 3537: 'leaves', 3538: 'mountain', 3541: 'sky', 3542: 'valley', 3543: 'sunset', 3544: 'waterfall', 3545: 'pond', 3548: 'beach', 3549: 'oak', 3551: 'garden', 3552: 'stream', 3554: 'forest', 3555: 'breeze', 3558: 'meadow'}
506
  ASURION = [423, 836, 2653, 2654, 2655, 2656, 2657, 2658, 3525, 3529, 3535, 3537, 3538, 3541, 3542, 3543, 3544, 3545, 3548, 3549, 3551, 3552, 3554, 3555, 3558]
507
  GOODCALL = [2653, 2654, 2655, 2657, 3525, 3529, 3537, 3545, 3549, 3551, 3552]
508
  CONVERSENOW = [3525, 3529, 3535, 3538, 3542, 3543, 3544, 3545, 3549, 3551, 3552]
509
  YLOPO = [2653, 2654, 2655, 2656, 2657, 2658, 3535, 3537, 3544, 3545, 3549, 3552]
 
510
 
511
  def synthesize(key, text, speakers_must, speed, request: gr.Request):
512
  print("Requesting user: ", request.username)
@@ -514,6 +516,8 @@ def synthesize(key, text, speakers_must, speed, request: gr.Request):
514
  goodcall_sids = GOODCALL
515
  conversenow_sids = CONVERSENOW
516
  ylopo_sids = YLOPO
 
 
517
  sids_must = []
518
  sids_random = []
519
  N = 5
@@ -535,6 +539,10 @@ def synthesize(key, text, speakers_must, speed, request: gr.Request):
535
  sids_random = random.choices([s for s in ylopo_sids if s not in sids_must], k=(N-len(sids_must)))
536
  if len(text) == 0:
537
  text = random.choice(YLOPO_TEXTS)
 
 
 
 
538
  sids = sids_must + [ivr_sid_to_name[r] for r in sids_random]
539
  print(sids)
540
  headers = {"Authorization": "Api-Key {}".format(key)}
@@ -577,5 +585,5 @@ gradio_app = gr.Interface(
577
  )
578
  gradio_app.launch(
579
  share=True,
580
- auth=[("asurion", "asurion"), ("goodcall", "goodcall"), ("conversenow", "conversenow"), ("ylopo", "ylopo")]
581
  )
 
51
  "You're very welcome. I've got everything updated, so we'll see you on the twenty fourth for your rescheduled haircut appointment with Helen at two p. m., including the deep conditioning treatment. Anything else I can help with today?",
52
  "Thanks for calling, have a great rest of your day!",
53
  ]
 
54
  SUPERSIZED = [
55
  "Good morning and welcome to Domino's. This is James.",
56
  "Are you calling to place a new order?",
 
501
  GOODCALL_TEXTS = SCHEDULE_ME
502
  CONVERSENEW_TEXTS = SUPERSIZED
503
  YLOPO_TEXTS = MONOPOLY
504
+ RIME_TEXTS = SCHEDULE_ME + SUPERSIZED + MONOPOLY
505
+
506
  ivr_sid_to_name = {423: 'whirlpool', 836: 'sunrise', 2653: 'butterfly', 2654: 'rainfall', 2655: 'canyon', 2656: 'jungle', 2657: 'hills', 2658: 'lake', 3525: 'wildflower', 3529: 'peak', 3535: 'river', 3537: 'leaves', 3538: 'mountain', 3541: 'sky', 3542: 'valley', 3543: 'sunset', 3544: 'waterfall', 3545: 'pond', 3548: 'beach', 3549: 'oak', 3551: 'garden', 3552: 'stream', 3554: 'forest', 3555: 'breeze', 3558: 'meadow'}
507
  ASURION = [423, 836, 2653, 2654, 2655, 2656, 2657, 2658, 3525, 3529, 3535, 3537, 3538, 3541, 3542, 3543, 3544, 3545, 3548, 3549, 3551, 3552, 3554, 3555, 3558]
508
  GOODCALL = [2653, 2654, 2655, 2657, 3525, 3529, 3537, 3545, 3549, 3551, 3552]
509
  CONVERSENOW = [3525, 3529, 3535, 3538, 3542, 3543, 3544, 3545, 3549, 3551, 3552]
510
  YLOPO = [2653, 2654, 2655, 2656, 2657, 2658, 3535, 3537, 3544, 3545, 3549, 3552]
511
+ RIME = [423, 836, 3525, 3529, 3535, 3537, 3538, 3541, 3542, 3543, 3544, 3545, 3548, 2653, 2654, 2655, 2656, 2657, 2658, 3549, 3551, 3552, 3554, 3555, 3558]
512
 
513
  def synthesize(key, text, speakers_must, speed, request: gr.Request):
514
  print("Requesting user: ", request.username)
 
516
  goodcall_sids = GOODCALL
517
  conversenow_sids = CONVERSENOW
518
  ylopo_sids = YLOPO
519
+ rime_sids = RIME
520
+
521
  sids_must = []
522
  sids_random = []
523
  N = 5
 
539
  sids_random = random.choices([s for s in ylopo_sids if s not in sids_must], k=(N-len(sids_must)))
540
  if len(text) == 0:
541
  text = random.choice(YLOPO_TEXTS)
542
+ elif request.username == "rime":
543
+ sids_random = random.choices([s for s in rime_sids if s not in sids_must], k=(N-len(sids_must)))
544
+ if len(text) == 0:
545
+ text = random.choice(RIME_TEXTS)
546
  sids = sids_must + [ivr_sid_to_name[r] for r in sids_random]
547
  print(sids)
548
  headers = {"Authorization": "Api-Key {}".format(key)}
 
585
  )
586
  gradio_app.launch(
587
  share=True,
588
+ auth=[("asurion", "asurion"), ("goodcall", "goodcall"), ("conversenow", "conversenow"), ("ylopo", "ylopo"), ("rime", "rime")]
589
  )