Spaces:
Runtime error
Runtime error
Danil
commited on
Commit
·
2515070
1
Parent(s):
63ca2f2
Fix
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ engine = os.environ["engine"]
|
|
8 |
|
9 |
|
10 |
def happytt(temperature,max_tokens,text,stop):
|
11 |
-
stop = stop.split(';')
|
12 |
response = openai.Completion.create(
|
13 |
engine=engine,
|
14 |
prompt=text,
|
@@ -17,7 +16,8 @@ def happytt(temperature,max_tokens,text,stop):
|
|
17 |
top_p=1,
|
18 |
frequency_penalty=0,
|
19 |
presence_penalty=0,
|
20 |
-
stop=stop
|
|
|
21 |
)
|
22 |
|
23 |
return response.choices[0].text
|
@@ -42,5 +42,5 @@ iface = gr.Interface( happytt,[ gr.inputs.Slider(0, 1, step=0.1),gr.inputs.Slide
|
|
42 |
gr.inputs.Textbox(type='str',
|
43 |
label="input prompt"),
|
44 |
gr.inputs.Textbox(type='str',
|
45 |
-
label='
|
46 |
iface.launch(debug=True)
|
|
|
8 |
|
9 |
|
10 |
def happytt(temperature,max_tokens,text,stop):
|
|
|
11 |
response = openai.Completion.create(
|
12 |
engine=engine,
|
13 |
prompt=text,
|
|
|
16 |
top_p=1,
|
17 |
frequency_penalty=0,
|
18 |
presence_penalty=0,
|
19 |
+
stop=[stop]
|
20 |
+
)
|
21 |
)
|
22 |
|
23 |
return response.choices[0].text
|
|
|
42 |
gr.inputs.Textbox(type='str',
|
43 |
label="input prompt"),
|
44 |
gr.inputs.Textbox(type='str',
|
45 |
+
label='token that indicate the end of the generation')],"text", title = title, description = description )
|
46 |
iface.launch(debug=True)
|