Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,14 @@ openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
7 |
|
8 |
def generate_keywords(scene_description):
|
9 |
response = openai.Completion.create(
|
10 |
-
model="text-davinci-003",
|
11 |
prompt=f"Generate a representative English keyword for the following scene description: {scene_description}",
|
12 |
-
max_tokens=60
|
|
|
13 |
)
|
14 |
keyword = response.choices[0].text.strip()
|
15 |
return keyword
|
16 |
-
|
17 |
# Gradio ์ฑ ์ ์
|
18 |
def gradio_app():
|
19 |
with gr.Blocks() as demo:
|
|
|
7 |
|
8 |
def generate_keywords(scene_description):
|
9 |
response = openai.Completion.create(
|
10 |
+
model="text-davinci-003", # ์ฌ์ฉํ ๋ชจ๋ธ์ ์ง์ ํฉ๋๋ค.
|
11 |
prompt=f"Generate a representative English keyword for the following scene description: {scene_description}",
|
12 |
+
max_tokens=60,
|
13 |
+
temperature=0.7
|
14 |
)
|
15 |
keyword = response.choices[0].text.strip()
|
16 |
return keyword
|
17 |
+
|
18 |
# Gradio ์ฑ ์ ์
|
19 |
def gradio_app():
|
20 |
with gr.Blocks() as demo:
|