Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ OPENAI_API_KEY = os.getenv("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"
|
|
12 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]):
|
13 |
|
14 |
# μ¬μ©μμ μ
λ ₯μ λλ μ΄μ
μ€νμΌμ ν둬ννΈλ‘ λ³ν
|
15 |
-
narration_prompt = f"λμμμ μ¬μ©ν μ λ¬Έμ μΈ λλ μ΄μ
μ
|
16 |
|
17 |
payload = {
|
18 |
"model": "gpt-4-1106-preview",
|
@@ -103,8 +103,8 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
103 |
def reset_textbox():
|
104 |
return gr.update(value='')
|
105 |
|
106 |
-
title = """<h1 align="center"
|
107 |
-
description = """
|
108 |
```
|
109 |
User: <utterance>
|
110 |
Assistant: <utterance>
|
@@ -114,15 +114,18 @@ Assistant: <utterance>
|
|
114 |
```
|
115 |
In this app, you can explore the outputs of a gpt-3.5-turbo LLM.
|
116 |
"""
|
117 |
-
|
|
|
118 |
with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
|
119 |
#chatbot {height: 520px; overflow: auto;}""") as demo:
|
120 |
gr.HTML(title)
|
121 |
with gr.Column(elem_id = "col_container"):
|
122 |
openai_api_key = gr.Textbox(type='password', label="Enter your OpenAI API key here")
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
126 |
b1 = gr.Button()
|
127 |
|
128 |
#inputs, top_p, temperature, top_k, repetition_penalty
|
|
|
12 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]):
|
13 |
|
14 |
# μ¬μ©μμ μ
λ ₯μ λλ μ΄μ
μ€νμΌμ ν둬ννΈλ‘ λ³ν
|
15 |
+
narration_prompt = f"λμμμ μ¬μ©ν μ λ¬Έμ μΈ λλ μ΄μ
μ μμ±νλΌ. λ°λμ νκΈλ‘ μμ±ν κ². μΌμ²΄μ μ§λ¬Έμ΄λ μ§μ, λ°°κ²½ μ€λͺ
λ±μ λ
ΈμΆ νκ±°λ μΆλ ₯νμ§ λ§κ³ μμν λλ μ΄μ
λ§ 2μ€μ© λ¬Άμ΄μ μ΅λ 8μ€ μ΄λ΄λ‘ μΆλ ₯λ ₯. μ
λ ₯: '{inputs}'"
|
16 |
|
17 |
payload = {
|
18 |
"model": "gpt-4-1106-preview",
|
|
|
103 |
def reset_textbox():
|
104 |
return gr.update(value='')
|
105 |
|
106 |
+
title = """<h1 align="center">νμ μ€ν¬λ¦½νΈ</h1>"""
|
107 |
+
description = """μμ μμ±μ μν μ€ν¬λ¦½νΈλ₯Ό AIκ° μλμΌλ‘ μμ±ν©λλ€. μ£Όμ ν€μλλ λͺ©μ λ± νμν λ΄μ©λ§ κ°λ¨ν μ
λ ₯νμΈμ. :
|
108 |
```
|
109 |
User: <utterance>
|
110 |
Assistant: <utterance>
|
|
|
114 |
```
|
115 |
In this app, you can explore the outputs of a gpt-3.5-turbo LLM.
|
116 |
"""
|
117 |
+
|
118 |
+
|
119 |
with gr.Blocks(css = """#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
|
120 |
#chatbot {height: 520px; overflow: auto;}""") as demo:
|
121 |
gr.HTML(title)
|
122 |
with gr.Column(elem_id = "col_container"):
|
123 |
openai_api_key = gr.Textbox(type='password', label="Enter your OpenAI API key here")
|
124 |
+
|
125 |
+
# μΆλ ₯νΌ (chatbot)μ μ¬μ©μ μ
λ ₯νΌ (inputs) μμ λ°°μΉ
|
126 |
+
chatbot = gr.Chatbot(elem_id='chatbot') # c
|
127 |
+
inputs = gr.Textbox(placeholder="μ¬κΈ°μ μ
λ ₯νμΈμ.", label="λλ μ΄μ
μ€ν¬λ¦½νΈλ₯Ό μμ±νκ³ μΆμ μ£Όμ μ΄λ λ¬Έμ₯μ μ
λ ₯νμΈμ.") # t
|
128 |
+
state = gr.State([]) # s
|
129 |
b1 = gr.Button()
|
130 |
|
131 |
#inputs, top_p, temperature, top_k, repetition_penalty
|