Spaces:
Runtime error
Runtime error
Danil
commited on
Commit
·
63ca2f2
1
Parent(s):
906d19a
Fix
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ engine = os.environ["engine"]
|
|
8 |
|
9 |
|
10 |
def happytt(temperature,max_tokens,text,stop):
|
11 |
-
|
12 |
response = openai.Completion.create(
|
13 |
engine=engine,
|
14 |
prompt=text,
|
@@ -17,7 +17,7 @@ def happytt(temperature,max_tokens,text,stop):
|
|
17 |
top_p=1,
|
18 |
frequency_penalty=0,
|
19 |
presence_penalty=0,
|
20 |
-
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 |
+
stop = stop.split(';')
|
12 |
response = openai.Completion.create(
|
13 |
engine=engine,
|
14 |
prompt=text,
|
|
|
17 |
top_p=1,
|
18 |
frequency_penalty=0,
|
19 |
presence_penalty=0,
|
20 |
+
stop=stop
|
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='Tokens that indicate the end of the generation. (use ";" for several)')],"text", title = title, description = description )
|
46 |
iface.launch(debug=True)
|