Spaces:
Runtime error
Runtime error
DmitrMakeev
commited on
Commit
•
3661cf2
1
Parent(s):
af5ecff
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,11 @@ from gradio import HuggingFaceDatasetSaver
|
|
4 |
api_k = 'sk'
|
5 |
openai.api_key = api_k
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
def openai_chat(prompt):
|
8 |
completions = openai.Completion.create(
|
9 |
engine="text-davinci-003",
|
@@ -22,7 +27,6 @@ def chatbot(input, history=[]):
|
|
22 |
return history, history
|
23 |
|
24 |
gr.Interface(fn = chatbot,
|
25 |
-
api_k = gr.Textbox(label="Ключ OpenAI API", type="password"),
|
26 |
inputs = ["text",'state'],
|
27 |
outputs = ["chatbot",'state'],
|
28 |
examples = [
|
|
|
4 |
api_k = 'sk'
|
5 |
openai.api_key = api_k
|
6 |
|
7 |
+
|
8 |
+
with gr.Blocks() as myface:
|
9 |
+
with gr.Row():
|
10 |
+
api_k = gr.Textbox(label="Ключ OpenAI API", type="password")
|
11 |
+
|
12 |
def openai_chat(prompt):
|
13 |
completions = openai.Completion.create(
|
14 |
engine="text-davinci-003",
|
|
|
27 |
return history, history
|
28 |
|
29 |
gr.Interface(fn = chatbot,
|
|
|
30 |
inputs = ["text",'state'],
|
31 |
outputs = ["chatbot",'state'],
|
32 |
examples = [
|