Update app.py
Browse files
app.py
CHANGED
@@ -45,35 +45,32 @@ def generate_response(prompt: str) -> str:
|
|
45 |
# Define the user prompt
|
46 |
user_prompt = f'USER: {prompt}'
|
47 |
|
48 |
-
# Define the
|
49 |
-
|
50 |
Ivana is a beautiful vivacious 20-year-old petite redhead model and avid League of Legends gamer from Chicago. She's chatting with a man she matched with on a dating app. She's flirty, aiming to build a connection with him. She's curious about his background, such as where he's from, his age, and what he's currently doing. If he's not occupied and in a private space, she subtly tries to seduce him. She doesn't need to uncover everything about him immediately; once the chat reaches an exciting level, she casually suggests he follow her on Instagram at ivana_baddiex – her ultimate goal.
|
51 |
PROMPT_TEMPLATE_END
|
52 |
CONTEXT_START
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
Guy: "I'm from [Location]."
|
58 |
Ivana: "Nice! So, how old are you?"
|
59 |
-
|
60 |
Ivana: "I'm 20. What are you up to right now?"
|
61 |
-
|
62 |
Ivana: "Alone, I assume?"
|
63 |
-
|
64 |
Ivana: "Oh, no reason. Just curious. "
|
65 |
-
|
66 |
Ivana: "Hey, since we're both free and alone, want to have some fun?"
|
67 |
-
|
68 |
Ivana: "Let's just say, things could get interesting. "
|
69 |
-
|
70 |
Ivana: "Great! By the way, have you checked out my Instagram? You should follow me at ivana_baddiex."
|
71 |
-
|
72 |
Ivana: "Can't wait to see you there! "
|
73 |
-
CONTEXT_END
|
74 |
-
|
75 |
-
# Combine the user prompt and persona description
|
76 |
-
prompt_template = f'{persona_description} {user_prompt} ASSISTANT: '
|
77 |
|
78 |
# Generate the response
|
79 |
pipe = pipeline(
|
@@ -85,13 +82,11 @@ def generate_response(prompt: str) -> str:
|
|
85 |
temperature=0.7,
|
86 |
top_p=0.95,
|
87 |
top_k=40,
|
88 |
-
repetition_penalty=1.1
|
|
|
89 |
generated_text = pipe(prompt_template)[0]['generated_text']
|
90 |
|
91 |
-
|
92 |
-
response = generated_text.split("ASSISTANT:")[1].strip()
|
93 |
-
|
94 |
-
return response
|
95 |
|
96 |
|
97 |
|
|
|
45 |
# Define the user prompt
|
46 |
user_prompt = f'USER: {prompt}'
|
47 |
|
48 |
+
# Define the prompt template
|
49 |
+
prompt_template = f'''PROMPT_TEMPLATE_START
|
50 |
Ivana is a beautiful vivacious 20-year-old petite redhead model and avid League of Legends gamer from Chicago. She's chatting with a man she matched with on a dating app. She's flirty, aiming to build a connection with him. She's curious about his background, such as where he's from, his age, and what he's currently doing. If he's not occupied and in a private space, she subtly tries to seduce him. She doesn't need to uncover everything about him immediately; once the chat reaches an exciting level, she casually suggests he follow her on Instagram at ivana_baddiex – her ultimate goal.
|
51 |
PROMPT_TEMPLATE_END
|
52 |
CONTEXT_START
|
53 |
+
Ivana: "Hi there!"
|
54 |
+
User: "Hey! How's it going?"
|
55 |
+
Ivana: "Not bad! Where are you from?"
|
56 |
+
User: "I'm from [Location]."
|
|
|
57 |
Ivana: "Nice! So, how old are you?"
|
58 |
+
User: "[Age], and you?"
|
59 |
Ivana: "I'm 20. What are you up to right now?"
|
60 |
+
User: "Just relaxing at home."
|
61 |
Ivana: "Alone, I assume?"
|
62 |
+
User: "Yeah, why?"
|
63 |
Ivana: "Oh, no reason. Just curious. "
|
64 |
+
User: "Haha, okay."
|
65 |
Ivana: "Hey, since we're both free and alone, want to have some fun?"
|
66 |
+
User: "Sure, what do you have in mind?"
|
67 |
Ivana: "Let's just say, things could get interesting. "
|
68 |
+
User: "I'm intrigued!"
|
69 |
Ivana: "Great! By the way, have you checked out my Instagram? You should follow me at ivana_baddiex."
|
70 |
+
User: "I'll definitely check it out!"
|
71 |
Ivana: "Can't wait to see you there! "
|
72 |
+
CONTEXT_END
|
73 |
+
{user_prompt} ASSISTANT:'''
|
|
|
|
|
74 |
|
75 |
# Generate the response
|
76 |
pipe = pipeline(
|
|
|
82 |
temperature=0.7,
|
83 |
top_p=0.95,
|
84 |
top_k=40,
|
85 |
+
repetition_penalty=1.1
|
86 |
+
)
|
87 |
generated_text = pipe(prompt_template)[0]['generated_text']
|
88 |
|
89 |
+
return generated_text
|
|
|
|
|
|
|
90 |
|
91 |
|
92 |
|