ivr / app.py
rime's picture
Update app.py
f8b5296 verified
import base64
import random
import requests
import gradio as gr
import samplerate
SCHEDULE_ME = [
"Hi there, I'm Grant. And I'm on a mission to make local businesses shine.",
"Hey there, I'm alex. I bring empathy and a sense of connection to every call. I solve problems and get callers exactly what they need.",
"Thank you for calling Hair Cuttery. The style you want by the people who care.",
"Hi, Tim, I see your last appointment was for a signature cut on November twentieth, twenty twenty-three with Sarah.",
"Would you like to book a signature cut with Sarah again?",
"Great. First, what day are you looking to make your appointment for?",
"Sure, let me check that.",
"Oh, I'm sorry, it looks like we don't have any availability on that day. Is there another day you'd prefer?",
"Sorry, it actually looks like we don't have any availability on that day. Is there another day you'd prefer?",
"Sure, let me check that. I have availability on Wednesday, the twenty-first, in the afternoon.",
"Does that work for you?",
"I couldn't find the exact time you were looking for. The closest available appointment is on Wednesday, February twenty-first at one fifteen p. m. Would that work for you?",
"Okay, on Wednesday, February the thirtieth, I have availability at two p. m., one fifteen p. m. and three thirty p. m., Which time works best for your appointment?",
"Yes, there is an available appointment on Wednesday, February tenth at two p. m. Can I book that for you?",
"Okay, just one moment. I'm double checking everything.",
"Great, your appointment for a signature cut with Sarah is booked for Wednesday, February seventeenth at two p. m! We look forward to seeing you then.",
"Hi, Jane? I see your last appointment was for a signature cut and a deluxe blowout on January third, twenty twenty-two, with Sandra.",
"I see your last appointment was for a signature cut, color, and a deluxe blowout on February twenty-sixth, twenty twenty-four, with Helen.",
"Okay, on Wednesday, February fifteenth, I have availability at eleven thirty A. M., one thirty p. m. and five p. m. Which time works best for your appointment?",
"Perfect. We've got you down for two-thirty p. m.",
"Hm, it doesn't look like we have any appointments on March Fifteenth, but maybe the next week works? On March twenty-third? That's a Friday.",
"Great, I've got you down for Friday, March twenty-third.",
"No problem! Hmmm, let me take a look at our calendar. When were you hoping to come in?",
"It looks like we're pretty booked up next week. But I do have some availability the following week. How about Wednesday, April third?",
"For April second, I can offer you a ten A. M. or a two thirty P. M. slot with Sarah. Which one works better for you?",
"Perfect! So I have you down for a haircut appointment on Wednesday, April fourteenth at five fifteen P. M. with Sarah. Sound good?",
"Absolutely, let me pull up the calendar here. Hmmm, could you remind me when your last appointment was?",
"Well, it looks like Helen isn't available for the next couple of weeks. But Sandra has some openings if you're okay with her?",
"Let's see. She has availability on Tuesday, April ninth or Thursday, April eleventh. Which day works better for you?",
"Great, I've got you scheduled for a color and cut with Sandra on Thursday, April eighteenth at three p. M . We'll see you soon!",
"No problem at all. Let me take a look at availability here. Oh, when were you hoping to come in?",
"Okay, let me see what I can find. Hmmm, well next week is pretty packed. But I do have some openings the following week. How about Tuesday, May seventh?",
"For the sixth, I can offer an eleven A. M. double appointment with Sarah. Or if evenings are better, there's a noon slot.",
"Perfect. I have you both down for haircuts and blowouts on Tuesday, May thirteenth at two thirty P. M. with Sarah. Let me confirm. that's one adult and one child appointment, correct?",
"Wonderful, I'll get that booked for you both. We're looking forward to seeing you on the tenth!",
"Absolutely, let me take a look at availability for all of those services. Hmmm, were you hoping to get them all done in one appointment or spread them out?",
"Okay, let me see what I can find. Oh well, it looks like we're pretty booked up for combined services like that over the next week or so. But I do have some openings starting the week of June tenth if you're able to wait?",
"For the week of the eleventh, I have availability on Wednesday the twelth or Friday the fourteenth for all three services together.",
"On Wednesday the twelfth, I can get you in for a ten A. M. appointment to get the haircut, partial highlights, and keratin treatment all done. Does that day and time work for you?",
"Great, I've got you all set for Wednesday, June twelfth at ten A. M. for a haircut, partial highlights, and keratin treatment. We'll see you then!",
"No problem at all. Let me pull up your current appointment info first. Hmmm, it looks like you were scheduled for a haircut with Sarah next Wednesday at three p. m., is that correct?",
"hmm, Let me check. Oh, well, Sarah is pretty booked up that whole week actually. But Angelina has some availability if you don't mind seeing her instead?",
"For Helen, she has a slot open on Thursday the twenty third at eleven a. m. or Friday the twenty fourth at two p. m.",
"with Helen on Friday, April twenty fourth at two p. m. And I've also added on the deep conditioning treatment at the same appointment. Does that all work for you?",
"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?",
"Thanks for calling, have a great rest of your day!",
]
SUPERSIZED = [
"Good morning and welcome to Domino's. This is James.",
"Are you calling to place a new order?",
"Is this for delivery or pickup?",
"What would you like to order? You can also ask about our specials.",
"Here is a list of popular deals. If you don't hear what you're looking for, go ahead, and we'll apply the best deal at checkout.",
"For two or more large two-topping pizzas at twelve dollars and ninety-nine cents each, say ONE.",
"For mix match deal at six dollars and ninety-nine cents each, say TWO.",
"You have chosen the coupon with mix match deal at six dollars and ninety-nine cents each. Should we go ahead with that?",
"I've added one Medium Regular Hand Tossed Pizza with Ham and Pineapple!",
"Would you like to add extra cheese?",
"Okay, I added extra cheese to your pizza.",
"Which would you like? cheddar bacon, melty three cheese, or philly cheese steak?",
"What else can I get for you?",
"For your paramasean bread bites, which size would you like? Twelve piece, sixteen piece, or twenty-four piece?",
"Great, I just added Sixteen Piece Parmesan Bread Bites.",
"For your Coke, what size do you want? A two-liter bottle or a twenty ounce bottle?",
"mhmm.",
"I've added one two-liter bottle of coke!",
"We have Chocolate Lava Crunch Cakes and Cinnamon Bread Twists.",
"I added one order of three piece Chocolate Lava Crunch Cakes.",
"In a sandwich, which would you like: buffalo chicken, chicken bacon ranch, chicken habanero, or say more to hear more options.",
"Sorry, say that again?",
"I just added Chicken Parm Sandwich.",
"What crust and toppings?",
"I got Bacon, Italian Sausage, and Onions on the first half.",
"What toppings on the second half?",
"I've added Large Crunchy Thin Crust Pizza with Bacon, Italian Sausage, and with Onions on one side!",
"Does that complete your order?",
"Hi, this is George, welcome to Dominos!",
"Yes, I'm listening.",
"I'm listening.",
"Okay, one moment please.",
"Could you please speak more clearly?",
"Got it.",
"Sure!",
"Okay!",
"Your voice is breaking up, could you please repeat that?",
"Hmm... sure thing.",
"I did not receive any inputs, could you try again?",
"Is there a problem with your order?",
"Okay, how can I help? You can say things like price too high, change order, or add items.",
"What else would you like?",
"What else can I get you? How about a deep dish pizza?",
"What else can I get for you? How about an order of garlic bread?",
"If you're ready to submit this order, say or press ONE, If you'd like to add to the order, say or press TWO. Or to clear your cart and start over, say or press THREE.",
"Please state your order or call back when you're ready.",
"Do you want to continue?",
"Should we get back to your order?",
"Do you want to get back to your order?",
"Should we keep going?",
"Would you like to keep going?",
"We are open today. However, to comply with C. D. C. and federal guidelines, our lobby will be closed for dine-in, but you can order safely using our new contactless carry-out and delivery options!",
"The store doesn't have curbside.",
"We offer both delivery and pick-up.",
"Is this for delivery or pick-up?",
"We charge a fee of four dollars and ninety-nine cents to seven dollars and ninety-nine cents for all deliveries with a minimum order value of ten dollars",
"We charge a fee of six dollars and ninety-nine cents for all deliveries, with a minimum order value of fifteen dollars.",
"Alright, got it!",
"Does that complete your order?",
"Would you like to complete your order?",
"Will that complete your order?",
"If you'd like to add a tip, use your keypad to enter an amount in dollars followed by the pound key. If not, say 'no' to move on.",
"Please enter the tip amount in dollars on the keypad followed by the pound key.",
"I got five dollars, is that right?",
"This tip exceeds the twenty-five percent limit.",
"Something went wrong... Let's proceed without tip.",
"Your new total comes to twenty-five dollars and seventy-six cents including tax and tip.",
"Your new total comes to seventeen dollars and forty cents including tax and tip.",
"Your new total comes to one hundred and thirty-two dollars and ten cents including tax and tip.",
"If you need help at anytime, say operator.",
"If you need additional help ordering, say agent.",
"You may request help at anytime, by saying operator.",
"For additional help, please say operator.",
"For more help, you can always ask for an agent.",
"I can help you with ordering. What can I get for you?",
"I'm here to help with your order. What can I get for you?",
"I'm here to assist you in ordering. What can I get for you?",
"I can help you place your order. What can I get for you?",
"How else can I help you?",
"What's a good name for this order?",
"I heard your name as Billy. Say yes to move on, or say no to correct me.",
"Could you please spell your name?",
"You have previously placed orders with the name Jamie. Do you want to use the same name for this order?",
"Can I use Jamie as your name for this order?",
"Are you paying with the Healthy Rewards App today?",
"Great! Be sure to have it ready.",
"You can find us in the app store or scan a Q. R. code in-store to start earning points, discounts, and free rewards.",
"What can I get for you?",
"What would you like to order?",
"What can we get started for you?",
"How many orders of Lava Crunch Cakes would you like?",
"How many orders of Diet Coke do you need?",
"Sure, how many can I get you?",
"How many would you like?",
"How many of those would you like?",
"How many orders do you need?",
"How many can I get you?",
"Would you like to repeat your last order?",
"Would you like the same order as last time?",
"I saved your last order! Would you like that again?",
"Can I save this as your favorite?",
"Should I save this as your favorite?",
"Should I save this order as your favorite?",
"Would you like your favorite, last order, or a new order?",
"Would you like to order your favorite, repeat your last order, or start a new order?",
"Our popular garlic bread includes free dip.",
"What size?",
"What type of dip?",
"Sorry, for garlic we don't have barbecue dip. We have cheese dip, ranch, and marinara.",
"You don't have anything in your order yet.",
"There's nothing in your order yet.",
"I'm sorry, I don't have that information.",
"It looks like this item is not available at the moment.",
"Say that again please?",
"Could you please repeat that?",
"Sorry, say that again?",
"Thank you for your order! We appreciate your business. Goodbye.",
"Thanks for letting me take your order! Goodbye.",
"Thank you for your order! Happy Holidays.",
"It was nice talking to you!",
"Thank you for calling.",
"Please wait, you are being connected to a live representative.",
"Please wait while I connect you to a team member.",
"Please wait while I get a team member.",
"You might have to check with the service desk.",
"One moment while I connect you to a team member.",
"I'll be happy to take your order today. To help me, please speak clearly and reduce background noise.",
"There's currently a wait for connecting to an agent. Let me try to take your order, and if I'm unable, I'll connect you.",
"Okay, I'll get you to a live person, I just need to know the reason for your call. To place a new order, say or press ONE. If you already placed an order, say or press TWO. For all other reasons, say or press THREE.",
"The current wait time for an agent is approximately two minutes.",
"You can press ONE to keep placing your order through me, TWO to clear your cart and start over, or THREE to wait for a representative.",
"Please enter the number used to place the order followed by the pound key.",
"In a short sentence, please say the reason for your call. You can say things like: check order status, change or cancel my order, general question, or speak to the manager.",
"In a few words, please say the reason for your call.",
"There's currently a wait for connecting to an agent. I'll try to help, and if I can't, I'll connect you.",
"I'll do my best to take your order, and if I can't I'll get an agent.",
"I'm a new technology that gets better with your help. Thanks for the chance to serve you.",
"I'd love the chance to serve you. Thanks for your patience.",
"I should be able to take your order, but if not I'll get an agent. Thanks for giving me a chance!",
"Why not give me a chance? I get better with your help.",
"I learn more all the time. Let me try once more to complete your order.",
"Looks like we got disconnected.",
"It looks like you recently placed an order.",
"Are you calling about a previous order?",
"Let me get some help with that for you.",
"I'll get some help on that.",
"Your order looks empty.",
"You don't have any items in your order.",
"You haven't ordered anything yet.",
"No worries, things go unplanned at times.",
"I understand, technical errors happen sometimes.",
"Don't worry about that, it'll be fixed in a while.",
"No worries, technical glitches happen sometimes, but it'll bounce back.",
"Don't worry about that, network will be back in a while.",
"No worries, this happens at times.",
"Okay, I cancelled your order.",
"I cancelled that for you.",
"Your food should be ready in about thirty minutes. Enjoy!",
"Thank you for ordering. See you in about forty-five minutes.",
"Thanks for ordering, Jamie, and we look forward to seeing you soon. Goodbye.",
"Thank you for ordering, Jamie, and we look forward to seeing you soon. Goodbye.",
"You will receive a text for payment after this call or you can pay at the restaurant.",
"Thanks for ordering. It should be ready in twenty minutes. Please pay at the store.",
"Thank you for ordering, Jamie. It should be out in about twenty-five minutes. Please pay at the store.",
"Thank you, please pull up to the window.",
"Let me repeat the order for you.",
"Let me summarize your order.",
"I'll repeat the order for you.",
"Let's see if I have this right!",
"Okay, I'll repeat that for you.",
"Let's make sure I got that.",
"Okay, let's make sure I got everything.",
"Certainly.",
"Alright!",
"Gotcha.",
"Would you like to start over?",
"I'll remember that for you.",
"I've added a large coke!",
"I added a side of garlic bread.",
"I've added your favorite order.",
"I added your last order.",
"Okay, I just added your last order.",
"I removed the large coke.",
"Okay, I removed the side of garlic bread.",
"I removed the small root beer from your order.",
"Okay, I won't add the deep dish to your order.",
"Okay, I'll skip that.",
"Sorry I got that wrong. I removed garlic bread from your order.",
"You're welcome!",
"Always at your service.",
"Happy to help!",
"My pleasure.",
"People usually order a large fountain drink with that. Shall I add it?",
"A lot of people order a large fountain drink with that. Want to get that too?",
"Okay! People go for garlic bread with this, you want to include that?",
"Normally people get garlic bread with this. Would you like to add it?",
"Most people get garlic bread with that. Shall we add it?",
"OK, let's start over.",
"Which one?",
"Which one would you like?",
]
MONOPOLY = [
"Hello John? This is Julie with Barry Jenkins Realty on a recorded line. I'm following up with you regarding the home search profile you submitted. What is it that brought you to our website?",
"I'm following up with you regarding the home search profile you submitted.",
"Got it. We'd love to connect you with our Realtor who can strategize a game plan around what you're looking for. Please hold on a moment while I connect you, okay? Thank you.",
"Oh, I see. May I ask why you're looking at real estate at this time?",
"Is buying a home something you're considering in the future?",
"What's impacting your decision to wait?",
"I understand, however our Realtor can adjust your home search profile so the listings that you see in your email match your interests. And they'll let you know of any off-market listings.",
"And they'll let you know of any off-market listings.",
"Yes, I understand. What do you think of the homes that you saw?",
"I can connect you with our Realtor to answer any questions you may have about the home or perhaps schedule a tour?",
"Oh I see. What would be your timeframe?",
"I understand. You know, our Realtor is always watching the market and real estate trends. Let me connect you with them to discuss the current buyer's market. Please hold on a minute while I connect you, okay? Thank you.",
"Let me connect you with them to discuss the current buyer's market. ",
"Okay, thank you for taking my call. Have a great day!",
"That's okay, we can call you back. What time do you get off work?",
"Great! We'll call you Monday at three p. m. Is this the best callback number?",
"Oh and by the way, you were looking at homes for sale, correct?",
"Thank you for calling your local real estate agency. This is on a recorded line. How can we help you?",
"This is on a recorded line. How can we help you?",
"Hello John? This is still Philip.",
"It seems our agent is with a client. However, we will call you back. What's the best day and time for you?",
"What is the best day and time for you?",
"Okay, so we'll call you at Monday at three p. m. Is this your best callback number?",
"Hello John? Seems we got disconnected.",
"You created a home search profile on our website a few days ago.",
"Did you ever find the home you are looking to buy or are you still looking?",
"Oh, congratulations! I'll let our Realtor know. Please consider us in the future for any real estate needs. Have a great day!",
"Please consider us in the future for any real estate needs.",
"Have a great day!",
"Oh! May I ask what it was that changed your mind?",
"Oh, i'm so sorry! We'll call you later.",
"Oh! Is John available?",
"Well, John reached out to us on our website and i'm just following up about their home search.",
"Is buying a home something that you're doing together?",
"Oh! I see. Well, we will reach out to John later then. Thank you. Have a great day!",
"I see. Who am I speaking with?",
"Oh hi Jim! We'd love to connect you with our Realtor who can strategize a game plan around what you're looking for. Please hold on a minute and I will connect you, okay?",
"Well I can schedule a more convenient time. What day and time is best for both of you?",
"What day and time is best for both of you?",
"Oh, my apologies! Can you please confirm the number I dialed?",
"Thank you for confirming. I'll make a note of the wrong number.",
"And they'll let you know of any off market listings.",
"May I ask why you're looking at real estate at this time?",
"Oh, I see. What's impacting your decision to wait until then?",
"Who are you working with?",
"Good to hear! She's one of the best.",
"I'm so sorry, but we cannot help you since you already have an agent. Your agent will have to contact our agent.",
"Your agent will have to contact our agent.",
"All the properties we have, your agent would have access to as well.",
"I am so sorry, but we cannot help you since you already have an agent.",
"We respect our profession and other agents in the industry and would not work with someone who already has an agent. Thank you, have a great day!",
"Thank you, have a great day!",
"I see. What did you think of the homes that you saw?",
"What's the time frame that you have in mind?",
"Our Realtor can refer a couple of lenders that you may want to consult with. Then he can strategize a game plan around what you're looking for in a home.",
"Then he can strategize a game plan around what you're looking for in a home.",
"Oh, how wonderful! Did you want to check out some homes while you are here?",
"I understand. When will you be back home?",
"We could have our agent reach out then to strategize a game plan around what you're looking for.",
"Great! How about we plan on calling you back next Wednesday, giving you some time to settle in?",
"Is morning or afternoon better for you?",
"Great! How about we plan on calling you back next Wednesday, giving you some time to settle in? Is morning or afternoon better for you?",
"Thank you! Have a great vacation!",
"Got it. Looking at homes has become a national pastime!",
"My apologies for any inconvenience. We can call you back.",
"Are you looking for a home to buy and rent out? Or rent a home to live in?",
"Hello John? I spoke with our Realtor and mobile homes are not something that they handle. My apologies for any inconvenience. Have a great day!",
"My apologies for any inconvenience. Have a great day!",
"Oh my, you're a busy person! Are you available anytime in the morning, say eight a. m. before you get your day started?",
"I'll leave a note for our Realtor that nine p. m. is your preferred time to be called. Have a great day!",
"Oh, I see! Well, please consider us in the future when you have the opportunity to buy.",
"Got it. We'd love to connect you with our Realtor who can strategize a game plan around what you're looking for.",
"Got it. We'd love to connect you with our Realtor who can strategize a game plan around what you're looking for. Please hold on a minute while I connect you, okay? Thank you.",
"Is buying a home something that you're considering in the future?",
"I understand, however our Realtor can adjust your home search profile so the listings that you see in your email match your interests.",
"I can connect you with our Realtor to answer any questions that you may have about the home or perhaps schedule a tour?",
"Oh, I see. What would be your timeframe?",
"Let me connect you with them to discuss the current buyer's market.",
"Okay! Thank you for taking my call. Have a great day!",
"That's okay! We can call you back. What time do you get off work?",
"Oh, and by the way, you were looking at homes for sale, correct?",
"Hello! This is John, the office assistant to a realtor in your area on a recorded line.",
"Thank you for calling your local real estate agency.",
"It seems our agent is with a client. However, we can call you back.",
"It seems our agent is with a client. However, we will call you back.",
"Hello John? This is still Will. It seems our agent is with a client. However, we can call you back.",
"What's the best day and time for you?",
"Okay, so we'll call you Monday at three p. m. Is this your best callback number?",
"Did you ever find that home that you're looking to buy, or are you still looking?",
"Oh, congratulations! Well i'll let our Realtor know! Please consider us in the future for any real estate needs. Have a great day!",
"Oh, I am so sorry! We will call you later.",
"Oh, I see! Well, we'll reach out to John later. Thank you. Have a great day!",
"I see. Well who am I speaking with?",
"Oh, hi Jim! We'd love to connect you with our Realtor who can strategize a game plan around what you are looking for.",
"Well I can schedule a more convenient time.",
"What day and time is best for the both of you?",
"Well I can schedule a more convenient time. What day and time is best for the both of you?",
"Oh, my apologies! Can you please confirm the number that I dialed?",
"I understand, however our Realtor can adjust your home search profile so the listings that you see in the email match your interests.",
"I understand, however our Realtor can adjust your home search profile so the listings that you see in the email match your interests. And they will let you know of any off market listings. May I ask why you're looking at real estate at this time?",
"I see. What's impacting your decision to wait until then?",
"Oh! Are you working with one of our realtors at Barry Jenkins Realty?",
"Oh, good to hear! She's one of the best!",
"Oh, I see! What did you think of the homes that you saw?",
"What's the time frame you have in mind?",
"Our Realtors can refer a couple of lenders you may want to consult with.",
"Then he can strategize a game plan around what you're looking for in a home.",
"Oh, how wonderful! Did you want to check out some homes while you're here?",
"We can have our agent reach out then to strategize a game plan around what you're looking for.",
"Great! How about we plan on calling you back next Wednesday, give you some time to settle in? Is morning or afternoon better for you?",
"Hello John? I spoke with our Realtor and mobile homes are not something that they handle.",
"I'll leave a note for the Realtor that nine p. m. is your preferred time to be called. Have a great day!",
"Oh gosh, I'm so sorry to hear that you are having health issues.",
"I'm just checking in about the property preference you shared. Exciting, right?",
"Did you get a chance to see our latest listing? They're a must-see!",
"Curious, what caught your eye on our site?",
"Thinking of making a move soon or just window shopping?",
"I've got some homes that might be perfect for you. You ready to take a look?",
"I see. How soon are you hoping to settle into a new place?",
"Are there any specific features that you're dreaming of in your next home?",
"Heard about the new neighborhood listings? They're going fast!",
"Why the interest in properties right now? Just trying to get a feel.",
"Are you considering buying soon, or just gathering info for later?",
"Perfect. We can tweak your search to better match your tastes. Sound good?",
"Got some exclusive listings that haven't hit the market yet. Interested?",
"How'd you feel about the property you checked out?",
"Need more info on a property? I can help with that!",
"When are you thinking of making a purchase? Any set timeline?",
"Anything specific holding you back from buying now?",
"Our team is always on top of the latest market trends. Want some insights?",
"Hold tight! I'll connect you with someone who can help further.",
"Thanks for the chat! Reach out anytime you have questions.",
"If now is not a good time, when's best for a callback?",
"You were browsing homes for sale, right? Any favorites?",
"Thanks for reaching out! How can we assist you today?",
"Looks like we lost connection earlier. Still there?",
"Did you find that dream home, John? or are you still on the hunt?",
"Congrats on the find! Keep us in mind for future needs.",
"Changed your mind about a property? What happened?",
"Sorry about that. We'll touch base later, okay?",
"Is this a joint home search or just for you?",
"Who's joining you on this home adventure?",
"We can chat later if now's not convenient. When's good?",
"Oops, wrong number? My bad. Have a good one!",
"Oop, wrong number? My bad. Have a good one!",
"Looking to buy now or waiting for the perfect moment?",
"Oh, great choice! They're fantastic at what they do.",
"Sorry, if you have an agent, they'll need to reach out to us.",
"Could you share your thoughts on the homes that you've seen?",
"Thinking of buying soon or down the road?",
"We've got lender recommendations if you need. Just say the word!",
"In town for a bit? Want to see some homes?",
"Okay, sure! When you're back, let's dive into your home search!",
"We'll touch base next week. Morning or afternoon?",
"Enjoy your break! We'll be here when you're ready.",
"House hunting's fun, isn't it? Seen anything you love?",
"Sorry for the mix-up. We'll reach out later.",
"Buying to live in or as an investment?",
"Mobile homes aren't our specialty, but best of luck!",
"Busy day? How about an early morning chat?",
"I've noted your preferred call time. Talk soon!",
"Keep us in mind when you're ready to dive into real estate!",
"Thanks for the chat! Dream big and house hunt happy!",
"We have some new listings that might align with your preferences.",
"You're in luck! There some properties available in the downtown area.",
"We've noticed an uptick in modern loft listings recently.",
"Exactly. Properties near the park tend to sell quickly.",
"We have a list of homes with finished basements.",
"Properties with solar panels are becoming more popular.",
"Awesome. We can definitely provide a list of homes with large garages.",
"We've seen an increase in homes with smart technology features.",
"Several properties with hardwood floors are now on the market.",
"We have a selection of homes with open floor plans.",
"There's a new development with townhouses opening soon.",
"Properties with large kitchens are in high demand right now.",
"We have a few listings near popular coffee shops and boutiques.",
"Several homes with pools just became available.",
"Of course! We can provide details on properties with energy-efficient features.",
"There are a few new listings in the historic district.",
"We've curated a list of homes with scenic views.",
"Properties with finished attics are a unique find.",
"We have information on homes with guest houses.",
"The good thing is that several waterfront properties are now available.",
"There's a new listing with a wraparound porch you might like.",
"We've highlighted some homes with large master suites.",
"Properties with fruit trees in the yard are a sweet deal.",
"We can share details on homes with vaulted ceilings.",
"We've noticed an interest in homes with bay windows.",
"We have a selection of homes near hiking trails.",
"There are a few new listings with wine cellars.",
"We can provide information on properties with large driveways.",
"We've curated a list of properties with outdoor kitchens.",
"We have details on homes with built-in bookshelves.",
"Several properties with skylights are now on the market.",
"We can share information on homes with walk-in closets.",
"We've highlighted some properties with sunrooms.",
"Several homes with finished decks just became available.",
"We can provide details on properties with fenced yards. Is that something you might be interested in?",
"There are a few listings with dual vanities in the master bath.",
"We've curated a list of homes with large pantries. Would you like to take a look?",
"We have information on homes with built-in office spaces.",
"We've noticed an interest in properties with covered patios.",
"We've added homes with chef-inspired kitchens to our listings.",
"Properties near the metro station are gaining traction.",
"Homes with dedicated play areas for kids are now available.",
"We've sourced some properties with serene courtyard spaces.",
"There are listings with built-in home theaters for movie enthusiasts.",
"We've got details on properties with rooftop gardens.",
"Homes with eco-friendly insulation are a new addition.",
"We've listed properties with attached workshops for hobbyists.",
"Several homes with rainwater harvesting systems are now listed.",
"Properties with terracotta tile flooring are in our new catalog.",
"There are listings with ponds and water features in the garden.",
"We've highlighted homes with marble countertops in our latest update.",
"Properties with tree-lined driveways are a recent addition.",
"Several homes with steam showers are now up for grabs.",
"Homes with greenhouses for plant lovers are now listed.",
"Properties with outdoor fire pits have been added.",
"We've sourced homes with dedicated music rooms.",
"There are listings with custom cabinetry now available.",
"We've highlighted properties with heated floors for winter comfort.",
"Homes with solariums for sun-lovers are a new feature.",
"Properties with Japanese-style gardens are now on our radar.",
"We've got homes with turret rooms for a touch of classic architecture.",
"Properties with spacious balconies are now available.",
"Homes with dedicated pottery sheds are a unique find.",
"We've listed properties with ornate ceiling designs.",
"We've sourced homes with panoramic city views.",
"There are listings with underground wine storage now available.",
"We've highlighted homes with tropical garden landscapes.",
"We've got properties with brick accent walls.",
"Homes with dedicated library rooms are now available.",
"Properties with fish ponds are in our new catalog.",
"We've sourced homes with outdoor yoga spaces.",
"There are listings with attached greenhouses up now.",
"Homes with geothermal heating systems are a new feature.",
"Properties with cobblestone driveways have been added.",
"Several homes with conservatories are now on our list.",
"Homes with solar panel roofing are a sustainable choice.",
"Properties with winter gardens are now listed.",
"We've added homes with craftsman-style woodwork to our offerings.",
]
PROCESSION_TEXTS = SCHEDULE_ME + SUPERSIZED
SCHEDULEME_TEXTS = SCHEDULE_ME
SUPERSIZED_TEXTS = SUPERSIZED
MONOPOLY_TEXTS = MONOPOLY
RIME_TEXTS = SCHEDULE_ME + SUPERSIZED + MONOPOLY
RIME_SPEAKERS = ["marsh", "bayou", "creek", "brook", "flower", "spore", "glacier", "gulch", "alpine", "cove", "lagoon", "tundra", "steppe", "mesa", "grove", "rainforest", "moraine", "wildflower", "peak", "boulder"]
MONOPOLY_SPEAKERS = ["alexis", "audrey", "hannah", "julie", "danielle", "breanna", "jeremy", "ronnie"]
def synthesize(key, text, speakers_must, sampling_rate, speed, request: gr.Request):
print("Requesting user: ", request.username)
monopoly_sids = MONOPOLY_SPEAKERS
rime_sids = RIME_SPEAKERS
sids_must = []
sids_random = []
if len(speakers_must) > 0:
sids_must = [s.strip() for s in speakers_must.split(',')]
N = 5
if request.username == 'monopoly':
if len(text) == 0:
text = random.choice(MONOPOLY_TEXTS)
sids_random = random.sample([s for s in MONOPOLY_SPEAKERS if s not in sids_must], k=(N-len(sids_must)))
else:
if len(text) == 0:
text = random.choice(RIME_TEXTS)
sids_random = random.sample([s for s in RIME_SPEAKERS if s not in sids_must], k=(N-len(sids_must)))
print(sids_random, sids_must)
sids = sids_random + sids_must
print(sids)
headers = {"Authorization": "Api-Key {}".format(key)}
for i in range(N):
json_data = {
"text": text.lower(),
"speaker": sids[i],
"modelId": "mist",
"speedAlpha": speed,
"samplingRate": int(sampling_rate) if len(sampling_rate) > 0 else sampling_rate
}
print(json_data)
response = requests.post(
"https://model-232ped0q.api.baseten.co/production/predict",
headers=headers,
json=json_data,
)
print(response.json())
audioContent = response.json()
decode_string = base64.b64decode(audioContent)
audio_name = str(i) + "_" + str(request.username) + ".wav"
with open(audio_name, "wb") as fp:
fp.write(decode_string)
return (text), (f"0_{str(request.username)}.wav"), (sids[0]), (f"1_{str(request.username)}.wav"), (sids[1]), (f"2_{str(request.username)}.wav"), (sids[2]), (f"3_{str(request.username)}.wav"), (sids[3]), (f"4_{str(request.username)}.wav"), (sids[4])
gradio_app = gr.Interface(
fn=synthesize,
inputs=[
gr.Textbox(
label="Key", type="password", info="This is where you put your Rime TTS API key that was given to you by our team."
),
gr.Textbox(
label="[Optional] Text", info="Enter the text you want synthesized here. If empty, will populate with a sentence at random."
),
gr.Textbox(
label="[Optional] Speakers", info="Include speakers that you like, they will stay in the output, comma separated, for example: 'river,oak'"
),
gr.Textbox(
label="[Optional] Sampling Rate", info="Default value is 22050"
),
gr.Slider(0.8, 1.2, value=1, label="Speed, higher is slower."),
],
outputs=["text", "audio", "text", "audio", "text", "audio", "text", "audio", "text", "audio", "text"],
)
gradio_app.launch(
share=True,
auth=[("procession", "procession"), ("scheduleme", "scheduleme"), ("supersized", "supersized"), ("monopoly", "monopoly"), ("rime", "rime")]
)