-
-
Save jurand71/f2815cdd132e68174107144a301a1988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import openai | |
import ipywidgets as widgets | |
openai.api_key = "#API Key" | |
def GPT3_Completion(prompt): | |
response = openai.Completion.create( | |
engine = 'text-davinci-003', | |
prompt = prompt, | |
temperature = 0.5, | |
max_tokens = 255, | |
frequency_penalty = 0, | |
presence_penalty = 0 | |
) | |
return print(response.choices[0].text) | |
# define the person for whom the wishes need to be prepared | |
to_whom_label = widgets.Label('Do kogo mają być skierowane życzenia?') | |
display(to_whom_label) | |
to_whom = widgets.Text(value='przyjaciela', disable=False) | |
display(to_whom) | |
# entry text | |
prompt = f""" | |
Napisz życzenia świąteczno-noworoczne skierowane do {to_whom.value} w trzech zdaniach, | |
używając słów zdrowie, szczęście, pogoda ducha, choinka | |
""" | |
GPT3_Completion(prompt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment