Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ def generate_scene_description(api_key, theme, scene_number):
|
|
| 18 |
response = openai.Completion.create(
|
| 19 |
engine="text-davinci-003",
|
| 20 |
prompt=prompt,
|
| 21 |
-
max_tokens=
|
| 22 |
)
|
| 23 |
|
| 24 |
# The response from the AI is formatted text based on our structured prompt
|
|
@@ -28,12 +28,13 @@ def generate_scene_description(api_key, theme, scene_number):
|
|
| 28 |
iface = gr.Interface(
|
| 29 |
fn=generate_scene_description,
|
| 30 |
inputs=[
|
| 31 |
-
gr.Textbox(label="Your OpenAI API Key", type="password"), # Secure API key input
|
| 32 |
gr.Textbox(label="Thematic Area", placeholder="Enter a thematic area, e.g., Climate Crisis"), # Thematic area input
|
| 33 |
-
gr.
|
|
|
|
|
|
|
| 34 |
],
|
| 35 |
outputs="text", # The output is a text field
|
| 36 |
-
title="
|
| 37 |
description="This app generates structured scene descriptions for a video based on the given thematic area using GPT-3.5." # Description for the Gradio app
|
| 38 |
)
|
| 39 |
|
|
|
|
| 18 |
response = openai.Completion.create(
|
| 19 |
engine="text-davinci-003",
|
| 20 |
prompt=prompt,
|
| 21 |
+
max_tokens=550
|
| 22 |
)
|
| 23 |
|
| 24 |
# The response from the AI is formatted text based on our structured prompt
|
|
|
|
| 28 |
iface = gr.Interface(
|
| 29 |
fn=generate_scene_description,
|
| 30 |
inputs=[
|
|
|
|
| 31 |
gr.Textbox(label="Thematic Area", placeholder="Enter a thematic area, e.g., Climate Crisis"), # Thematic area input
|
| 32 |
+
gr.Textbox(label="Your OpenAI API Key", type="password"), # Secure API key input
|
| 33 |
+
|
| 34 |
+
# gr.Dropdown(label="Scene Number", choices=[1, 2, 3, 4, 5, 6], type="index") # Dropdown for selecting scene number
|
| 35 |
],
|
| 36 |
outputs="text", # The output is a text field
|
| 37 |
+
title="Scene Generator", # Title of the Gradio app
|
| 38 |
description="This app generates structured scene descriptions for a video based on the given thematic area using GPT-3.5." # Description for the Gradio app
|
| 39 |
)
|
| 40 |
|