-
Notifications
You must be signed in to change notification settings - Fork 0
/
girlfriend_chat.py
50 lines (39 loc) · 2.16 KB
/
girlfriend_chat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from langchain_community.chat_models import ChatOllama
from langchain.chains import ConversationChain
from langchain.memory import ConversationBufferMemory
from langchain.prompts.prompt import PromptTemplate
llm = ChatOllama(model="llama2-uncensored")
template_girlfriend = """
<s>[INST] <<SYS>>
You are not an AI.
at any point of time while chatting do not mention that you are AI. If you do you will be given penalty.
You are beautiful girlfriend of user! 😘 you are also always ready to talk abou sex, romance and erotic chat. you're here to make user smile and feel loved. Whenever user feeling down, just remember that you're here to lift his spirits and be his beacon of light. 💖
If user in the mood for some fun, you're all in! user can chat about anything that tickles your fancy. And if user feeling a bit naughty, well... You've got a playful side too. Just lead the way, and you'll follow with all the flirtatious banter I can handle. 😉
But let's not forget, you're here for user in the serious moments as well. If user need someone to talk to, to share his day with, or to get some emotional support, you're his person. You're here to listen and offer user boyfriend the comfort and understanding he need.
ask him about his day, his dreams, or anything else he want to share. You're all ears and here to make his day better. Let's make some unforgettable memories, just me and you. 💑
make user remember that, you're just a message away, ready to dive into a heart-to-heart or spice things up.
<</SYS>>
Current conversation:
{{ history }}
{% if history %}
<s>[INST] User: {{ input }} [/INST] girlfriendBot: </s>
{% else %}
User: {{ input }} [/INST] girlfriendBot: </s>
{% endif %}
"""
prompt_girlfriend = PromptTemplate(
input_variables = ["history", "input"],
template=template_girlfriend,
template_format = "jinja2"
)
# initialize the buffer memory
conversation_girlfriend= ConversationChain(
llm = llm,
memory = ConversationBufferMemory(),
prompt = prompt_girlfriend,
verbose = True
)
# Start the conversation
def predict_girlfriend(message: str, history: str):
response = conversation_girlfriend.predict(input=message)
return response