Spaces:
Sleeping
Sleeping
Commit
·
6a691cc
1
Parent(s):
8f7187c
Update app.py
Browse files
app.py
CHANGED
@@ -8,15 +8,16 @@ def generate_response(prompt, temperature):
|
|
8 |
output = co.generate(
|
9 |
model='9b2e329d-7542-4c44-8f8c-cac03a6c4f5a-ft',
|
10 |
prompt=prompt,
|
11 |
-
|
12 |
)
|
13 |
response = output.generations[0].text
|
14 |
return response
|
15 |
|
16 |
iface = gr.Interface(fn=generate_response,
|
17 |
-
inputs="
|
|
|
18 |
outputs="text",
|
19 |
title='Cohere Text Generation',
|
20 |
description='Enter your prompt to generate text')
|
21 |
|
22 |
-
iface.launch(share=True)
|
|
|
8 |
output = co.generate(
|
9 |
model='9b2e329d-7542-4c44-8f8c-cac03a6c4f5a-ft',
|
10 |
prompt=prompt,
|
11 |
+
options={'temperature': temperature} # set temperature
|
12 |
)
|
13 |
response = output.generations[0].text
|
14 |
return response
|
15 |
|
16 |
iface = gr.Interface(fn=generate_response,
|
17 |
+
inputs=[gr.inputs.Textbox(lines=2, label="Prompt"),
|
18 |
+
gr.inputs.Slider(minimum=0, maximum=1, default=0.5, label="Temperature")],
|
19 |
outputs="text",
|
20 |
title='Cohere Text Generation',
|
21 |
description='Enter your prompt to generate text')
|
22 |
|
23 |
+
iface.launch(share=True)
|