Spaces:
Build error
Build error
Commit
·
66420bf
1
Parent(s):
0d048b9
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
openai.api_key = "sk-" # Replace this with your API key: https://beta.openai.com/docs/quickstart/add-your-api-key
|
| 5 |
|
|
|
|
| 6 |
def openai_chat(prompt):
|
| 7 |
completions = openai.Completion.create(
|
| 8 |
engine="text-davinci-003",
|
|
@@ -15,6 +16,7 @@ def openai_chat(prompt):
|
|
| 15 |
message = completions.choices[0].text
|
| 16 |
return message.strip()
|
| 17 |
|
|
|
|
| 18 |
def chatbot(key, input, history=[]):
|
| 19 |
openai.api_key = key
|
| 20 |
output = openai_chat(input)
|
|
|
|
| 3 |
|
| 4 |
openai.api_key = "sk-" # Replace this with your API key: https://beta.openai.com/docs/quickstart/add-your-api-key
|
| 5 |
|
| 6 |
+
# openai
|
| 7 |
def openai_chat(prompt):
|
| 8 |
completions = openai.Completion.create(
|
| 9 |
engine="text-davinci-003",
|
|
|
|
| 16 |
message = completions.choices[0].text
|
| 17 |
return message.strip()
|
| 18 |
|
| 19 |
+
# gradio
|
| 20 |
def chatbot(key, input, history=[]):
|
| 21 |
openai.api_key = key
|
| 22 |
output = openai_chat(input)
|