SUHHHH commited on
Commit
eca5a29
·
verified ·
1 Parent(s): ebe28f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -69,6 +69,9 @@ with gr.Blocks() as demo:
69
  # 입력4: 참조글 3
70
  ref3 = gr.Textbox(label="참조글 3", lines=3)
71
 
 
 
 
72
  # 결과 출력
73
  answer_output = gr.Textbox(label="결과", lines=10, interactive=False)
74
 
@@ -76,7 +79,7 @@ with gr.Blocks() as demo:
76
  system_message = gr.Textbox(
77
  value="""반드시 한글로 답변할 것.
78
  너는 최고의 블로그 글 생성기이다.
79
- 주어진 참조글을 바탕으로 블로그 글을 생성하라.
80
  말투는 선택된 옵션에 맞게 조정하라.
81
  """,
82
  visible=False # UI에서 숨김
@@ -88,9 +91,9 @@ with gr.Blocks() as demo:
88
  # 전송 버튼
89
  submit_button = gr.Button("생성")
90
 
91
- def merge_and_call_cohere(tone, ref1, ref2, ref3, sys_msg, mt, temp, top_p_):
92
- # 참조글을 합쳐서 질문 구성
93
- question = f"말투: {tone}\n참조글 1: {ref1}\n참조글 2: {ref2}\n참조글 3: {ref3}"
94
  hf_token = os.environ.get("HF_TOKEN")
95
  return respond_cohere_qna(
96
  question=question,
@@ -104,7 +107,7 @@ with gr.Blocks() as demo:
104
  submit_button.click(
105
  fn=merge_and_call_cohere,
106
  inputs=[
107
- tone_radio, ref1, ref2, ref3,
108
  system_message,
109
  max_tokens,
110
  temperature,
 
69
  # 입력4: 참조글 3
70
  ref3 = gr.Textbox(label="참조글 3", lines=3)
71
 
72
+ # 입력5: 내 글 내용
73
+ my_content = gr.Textbox(label="내 글 내용", lines=3, placeholder="내가 쓰고 싶은 주제를 입력하세요.")
74
+
75
  # 결과 출력
76
  answer_output = gr.Textbox(label="결과", lines=10, interactive=False)
77
 
 
79
  system_message = gr.Textbox(
80
  value="""반드시 한글로 답변할 것.
81
  너는 최고의 블로그 글 생성기이다.
82
+ 주어진 참조글과 내 글 내용을 바탕으로 블로그 글을 생성하라.
83
  말투는 선택된 옵션에 맞게 조정하라.
84
  """,
85
  visible=False # UI에서 숨김
 
91
  # 전송 버튼
92
  submit_button = gr.Button("생성")
93
 
94
+ def merge_and_call_cohere(tone, ref1, ref2, ref3, my_content, sys_msg, mt, temp, top_p_):
95
+ # 참조글과 내 글 내용을 합쳐서 질문 구성
96
+ question = f"말투: {tone}\n참조글 1: {ref1}\n참조글 2: {ref2}\n참조글 3: {ref3}\n내 글 내용: {my_content}"
97
  hf_token = os.environ.get("HF_TOKEN")
98
  return respond_cohere_qna(
99
  question=question,
 
107
  submit_button.click(
108
  fn=merge_and_call_cohere,
109
  inputs=[
110
+ tone_radio, ref1, ref2, ref3, my_content,
111
  system_message,
112
  max_tokens,
113
  temperature,