Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,15 +47,12 @@ def respond_cohere_qna(
|
|
47 |
# UI 설정
|
48 |
#############################
|
49 |
|
|
|
|
|
|
|
50 |
with gr.Blocks() as demo:
|
51 |
gr.Markdown("# 블로그 생성기")
|
52 |
|
53 |
-
hf_token_box = gr.Textbox(
|
54 |
-
label="HuggingFace 토큰",
|
55 |
-
type="password",
|
56 |
-
placeholder="HuggingFace API 토큰을 입력하세요..."
|
57 |
-
)
|
58 |
-
|
59 |
input1 = gr.Textbox(label="말투바꾸기", lines=1)
|
60 |
input2 = gr.Textbox(label="참조글1", lines=1)
|
61 |
input3 = gr.Textbox(label="참조글2", lines=1)
|
@@ -95,7 +92,7 @@ with gr.Blocks() as demo:
|
|
95 |
|
96 |
submit_button = gr.Button("전송")
|
97 |
|
98 |
-
def merge_and_call_cohere(i1, i2, i3, i4, i5
|
99 |
question = " ".join([i1, i2, i3, i4, i5])
|
100 |
return respond_cohere_qna(
|
101 |
question=question,
|
@@ -103,14 +100,12 @@ with gr.Blocks() as demo:
|
|
103 |
max_tokens=4000,
|
104 |
temperature=0.7,
|
105 |
top_p=0.95,
|
106 |
-
hf_token=
|
107 |
)
|
108 |
|
109 |
submit_button.click(
|
110 |
fn=merge_and_call_cohere,
|
111 |
-
inputs=[
|
112 |
-
input1, input2, input3, input4, input5, hf_token_box
|
113 |
-
],
|
114 |
outputs=answer_output
|
115 |
)
|
116 |
|
|
|
47 |
# UI 설정
|
48 |
#############################
|
49 |
|
50 |
+
# HuggingFace 토큰 값을 하드코딩 (필요에 따라 값을 변경하세요)
|
51 |
+
HUGGINGFACE_TOKEN = "YOUR_HUGGINGFACE_TOKEN"
|
52 |
+
|
53 |
with gr.Blocks() as demo:
|
54 |
gr.Markdown("# 블로그 생성기")
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
input1 = gr.Textbox(label="말투바꾸기", lines=1)
|
57 |
input2 = gr.Textbox(label="참조글1", lines=1)
|
58 |
input3 = gr.Textbox(label="참조글2", lines=1)
|
|
|
92 |
|
93 |
submit_button = gr.Button("전송")
|
94 |
|
95 |
+
def merge_and_call_cohere(i1, i2, i3, i4, i5):
|
96 |
question = " ".join([i1, i2, i3, i4, i5])
|
97 |
return respond_cohere_qna(
|
98 |
question=question,
|
|
|
100 |
max_tokens=4000,
|
101 |
temperature=0.7,
|
102 |
top_p=0.95,
|
103 |
+
hf_token=HUGGINGFACE_TOKEN
|
104 |
)
|
105 |
|
106 |
submit_button.click(
|
107 |
fn=merge_and_call_cohere,
|
108 |
+
inputs=[input1, input2, input3, input4, input5],
|
|
|
|
|
109 |
outputs=answer_output
|
110 |
)
|
111 |
|