Skip to content

Instantly share code, notes, and snippets.

@bddppq
Last active September 16, 2023 05:22
Show Gist options
  • Save bddppq/65ba981fa7d48bf33f1b7e164fe0b401 to your computer and use it in GitHub Desktop.
Save bddppq/65ba981fa7d48bf33f1b7e164fe0b401 to your computer and use it in GitHub Desktop.
pygmalion-13b
import openai
openai.api_base = "https://pygmalion-13b.lepton.run/api/v1"
openai.api_key = "YOUR_API_KEY"
prompt = '''
Assistant's Persona: Assistant is a highly intelligent language model trained to comply with user requests.
<START>
Assistant: Hello! How may I help you today?
You: What is Zork?
Assistant:
'''
completion = openai.Completion.create(
model="pygmalion-13b", # can be "gpt-3.5-turbo" as well
prompt=prompt,
max_tokens=512,
stream=True,
)
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