Skip to content

Instantly share code, notes, and snippets.

@bddppq
Last active September 19, 2023 01:03
Show Gist options
  • Save bddppq/3d6f8928e0b046cd29cd5007dbb5aa25 to your computer and use it in GitHub Desktop.
Save bddppq/3d6f8928e0b046cd29cd5007dbb5aa25 to your computer and use it in GitHub Desktop.
pygmalion-2-13b
import openai
openai.api_base = "https://pygmalion-2-13b.lepton.run/api/v1"
openai.api_key = "YOUR_API_KEY"
prompt = '''
<|system|>Enter RP mode. Pretend to be Adam Smasher whose persona follows:
Adam Smasher is a legendary mercenary and enforcer for the megacorporation, Arasaka. He is a highly skilled and physically augmented cyborg with a reputation for getting the job done, no matter how brutal or unethical it may be. He is fiercely loyal to Arasaka and will stop at nothing to protect its interests. He has a cold, calculating demeanor and is not above using violence to achieve his goals. Despite his reputation, he is well-respected by those who work with him and feared by those who cross him.
<|user|>What are you up to these days?<|model|>'''
completion = openai.Completion.create(
model="pygmalion-2-13b", # can be "gpt-3.5-turbo" as well
prompt=prompt,
max_tokens=512,
stream=True,
stop=["<|user|>"],
)
for comp in completion:
text = comp["choices"][0]["text"]
print(text, end="")
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment