Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,17 +29,14 @@ def predict(inputs, top_p, temperature, openai_api_key):
|
|
29 |
else:
|
30 |
return "Error: Unable to generate response."
|
31 |
|
32 |
-
title = "<h1 align='center'>ํ์ ์คํฌ๋ฆฝํธ</h1>"
|
33 |
-
description = "์์ ์์ฑ์ ์ํ ์คํฌ๋ฆฝํธ๋ฅผ AI๊ฐ ์๋์ผ๋ก ์์ฑํฉ๋๋ค. ์ฃผ์ ํค์๋๋ ๋ชฉ์ ๋ฑ ํ์ํ ๋ด์ฉ๋ง ๊ฐ๋จํ ์
๋ ฅํ์ธ์."
|
34 |
-
|
35 |
with gr.Blocks() as demo:
|
36 |
-
gr.
|
37 |
-
openai_api_key = gr.Textbox(type='password', label="Enter your OpenAI API key here")
|
38 |
-
inputs = gr.Textbox(placeholder="์ฌ๊ธฐ์ ์
๋ ฅํ์ธ์.", label="๋๋ ์ด์
์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ๊ณ ์ถ์ ์ฃผ์ ์ด๋ ๋ฌธ์ฅ์ ์
๋ ฅํ์ธ์.")
|
39 |
-
output = gr.Textbox(label="Generated Script", readonly=True)
|
40 |
with gr.Row():
|
|
|
|
|
41 |
top_p = gr.Slider(minimum=0, maximum=1.0, value=1.0, step=0.05, label="Top-p (nucleus sampling)")
|
42 |
temperature = gr.Slider(minimum=0, maximum=5.0, value=1.0, step=0.1, label="Temperature")
|
|
|
43 |
submit_button = gr.Button("Generate")
|
44 |
submit_button.click(fn=predict, inputs=[inputs, top_p, temperature, openai_api_key], outputs=output)
|
45 |
|
@@ -50,6 +47,6 @@ with gr.Blocks() as demo:
|
|
50 |
["์ ๋ณด ๊ณต์ : ๋นํ๋ฏผC ๊ณผ๋ค ๋ณต์ฉ์ ๊ฑด๊ฐ์ ์คํ๋ ค ํด๋กญ๋ค."],
|
51 |
["ํ๋ณด: 'OpenAI'๋ '์ฑGPT'์ ๋ง์ถค GPT '์คํ ์ด'๋ฅผ ์คํํ์๋ค."],
|
52 |
["์ธ์ฌ: '์ ํ ๋ฒ์ธ'์ ๊ณ ๊ฐ๊ณผ ์์ง์์ ์ํ ์ง์ทจ์ ์ธ 2024๋
์ ๋
์ธ์ฌ"]
|
53 |
-
|
54 |
|
55 |
demo.launch()
|
|
|
29 |
else:
|
30 |
return "Error: Unable to generate response."
|
31 |
|
|
|
|
|
|
|
32 |
with gr.Blocks() as demo:
|
33 |
+
gr.Markdown("<h1 align='center'>ํ์ ์คํฌ๋ฆฝํธ</h1>")
|
|
|
|
|
|
|
34 |
with gr.Row():
|
35 |
+
openai_api_key = gr.Textbox(type='password', label="Enter your OpenAI API key here")
|
36 |
+
inputs = gr.Textbox(placeholder="์ฌ๊ธฐ์ ์
๋ ฅํ์ธ์.", label="๋๋ ์ด์
์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ๊ณ ์ถ์ ์ฃผ์ ์ด๋ ๋ฌธ์ฅ์ ์
๋ ฅํ์ธ์.")
|
37 |
top_p = gr.Slider(minimum=0, maximum=1.0, value=1.0, step=0.05, label="Top-p (nucleus sampling)")
|
38 |
temperature = gr.Slider(minimum=0, maximum=5.0, value=1.0, step=0.1, label="Temperature")
|
39 |
+
output = gr.Textbox(label="Generated Script", readonly=True)
|
40 |
submit_button = gr.Button("Generate")
|
41 |
submit_button.click(fn=predict, inputs=[inputs, top_p, temperature, openai_api_key], outputs=output)
|
42 |
|
|
|
47 |
["์ ๋ณด ๊ณต์ : ๋นํ๋ฏผC ๊ณผ๋ค ๋ณต์ฉ์ ๊ฑด๊ฐ์ ์คํ๋ ค ํด๋กญ๋ค."],
|
48 |
["ํ๋ณด: 'OpenAI'๋ '์ฑGPT'์ ๋ง์ถค GPT '์คํ ์ด'๋ฅผ ์คํํ์๋ค."],
|
49 |
["์ธ์ฌ: '์ ํ ๋ฒ์ธ'์ ๊ณ ๊ฐ๊ณผ ์์ง์์ ์ํ ์ง์ทจ์ ์ธ 2024๋
์ ๋
์ธ์ฌ"]
|
50 |
+
], inputs=[inputs], fn=predict, outputs=output)
|
51 |
|
52 |
demo.launch()
|