File size: 12,730 Bytes
276eea4
 
 
9b70eb1
5c085a0
 
 
276eea4
1080e1f
5c085a0
276eea4
1080e1f
 
 
 
 
 
 
276eea4
5c085a0
 
 
 
 
1080e1f
276eea4
 
1080e1f
 
 
 
 
276eea4
 
 
5c085a0
276eea4
 
1080e1f
 
 
97263c7
 
 
 
 
 
 
 
 
1080e1f
97263c7
3865332
 
 
 
97263c7
1080e1f
 
 
97263c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1080e1f
 
97263c7
 
 
 
3865332
 
 
97263c7
1080e1f
97263c7
 
 
 
3865332
 
 
97263c7
 
 
 
 
1080e1f
97263c7
1080e1f
 
276eea4
 
3865332
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import gradio as gr
from huggingface_hub import InferenceClient


# Function to create an Inference Client based on selected model
def create_inference_client(model_name):
    return InferenceClient(model_name)


# Function to generate a response
def respond(
        question,
        answer,
        system_message,
        model,
        max_tokens,
        temperature,
        top_p,
):
    # Create InferenceClient based on model selection
    client = create_inference_client(model)
    prompt = f"{system_message}[Question]\n{question}\n\n[μ–΄μ‹œμŠ€ν„΄νŠΈ λ‹΅λ³€μ˜ μ‹œμž‘]\n{answer}\n[μ–΄μ‹œμŠ€ν„΄νŠΈ λ‹΅λ³€μ˜ 끝]"
    messages = [{"role": "system", "content": ""}]
    messages.append({"role": "user", "content": prompt})

    response = ""
    for message in client.chat_completion(
            messages,
            max_tokens=max_tokens,
            stream=True,
            temperature=temperature,
            top_p=top_p,
    ):
        token = message.choices[0].delta.content
        response += token
        print(response)
        yield response


def main():
    description_text = """
    </br><span style="font-size: 22px;">Use <strong>Keval</strong>, an offline-ready evaluation framework for Korean AI models, to assess whether an LLM-generated response is relevant and appropriate for a given question. Submit the inputs to generate the evaluation results.</span></br></br>
    <span style="font-size: 22px;">1️⃣ <strong>Question</strong>: Provide a question from the ko-bench dataset.</span> </br>
    <span style="font-size: 22px;">2️⃣ <strong>Answer</strong>: Input the LLM-generated response to the Question.</span> </br>
    <span style="font-size: 22px;">3️⃣ <strong>System Message</strong>: Define the prompt used for evaluation.</span> </br>
    <span style="font-size: 22px;">4️⃣ <strong>Model Selection</strong>: Choose a Keval model for assessment.</span> </br>
    <span style="font-size: 22px;">5️⃣ <strong>Max New Tokens</strong>: Set the maximum number of tokens for the evaluation output.</span> </br>
    <span style="font-size: 22px;">6️⃣ <strong>Temperature</strong>: Adjust the temperature to balance predictability and creativity in Keval’s evaluation.</span> </br>
    <span style="font-size: 22px;">7️⃣ <strong>Top-p (Nucleus Sampling)</strong>: Modify the top-p value to control fluency and diversity in the evaluation output.</span> </br></br>
    <span style="font-size: 22px;"><a href="https://huggingface.co/davidkim205/keval-2-9b" target="_blank" style="text-decoration: none; color: #000080;">Keval model link << Click here!</a></span> </br></br>
    """

    examples_list = [["졜근 μ œμ£Όλ„ 여행을 λ‹€λ…€μ˜€λ©΄μ„œ κΌ­ 가봐야 ν•  λͺ…μ†Œλ₯Ό κ°•μ‘°ν•˜λŠ” μž¬λ―ΈμžˆλŠ” μ—¬ν–‰ λΈ”λ‘œκ·Έ 글을 μž‘μ„±ν•˜μ‹œμ˜€.","## μ œμ£Όλ„? μ˜€λŠ˜λΆ€ν„° \"μ œμ£Όλ„ νƒν—˜κ°€\"둜 μ°νžˆλŠ” 법! 🏝️πŸ”₯\n\nμ œμ£Όλ„, κ·Έ μžμ²΄λ‘œλ„ λ©‹μ§„ 이름이죠? λ°”λ‹€κ°€ κ·Έλ €λ‚Έ 섬, ν•˜λŠ˜μ΄ λΉšμ–΄λ‚Έ μžμ—°, 그리고 μΈκ°„μ˜ 손길이 λ§Œλ“  λ§€λ ₯κΉŒμ§€! 제주 νƒν—˜κ°€κ°€ 되기 μœ„ν•΄ κΌ­ 가봐야 ν•  λͺ…μ†Œλ“€, 뭐가 μžˆμ„κΉŒμš”? μ—¬κΈ° λ”±νžˆ μž‘μ±„μ²˜λŸΌ κΈ°λŒ€λ˜λŠ” μˆœκ°„μ΄ μžˆμ§€ μ•Šλ‚˜μš”? κ·Έ μˆœκ°„μ„ λ§Œλ“œλŠ” 곳듀이 λ°”λ‘œ 이곳이라면, 뭐가 λ“€μ—ˆλ‚˜ λ³΄μ„Έμš”!\n\n**1. 유λͺ…ν•œ 곳도, μˆ¨κ²¨μ§„ 보석도 νƒν—˜ν•΄λ΄μ•Όμ§€!**\n\nμ œμ£Όλ„μ—μ„œ 빠질 수 μ—†λŠ” λͺ…μ†Œμ£ . ν•œλΌμ‚°μ˜ μ‹ λΉ„ν•œ μžμ—° 속에 μˆ¨κ²¨μ§„ μˆ²κΈΈμ„ 걸으며, λ°”λ‹€ λ„ˆλ¨Έμ˜ ν‘Έλ₯Έ 끝을 μ—Ώλ³Ό 수 μžˆλŠ” ν•œλΌμ‚° λ“±λ°˜μ€ μžŠμ§€ λͺ»ν•  κ²½ν—˜μ„ 선사할 κ±°μ˜ˆμš”. ν•˜μ§€λ§Œ 이곳의 λ§€λ ₯은 κ·Έ 자체둜 λλ‚˜μ§€ μ•Šμ•„μš”. μˆ¨κ²¨μ§„ 보석 같은 곳듀을 μ°Ύμ•„λ‚΄λŠ” 것이 제주 νƒν—˜κ°€μ˜ 재미죠! 예λ₯Ό λ“€μ–΄, μ˜€λ¦„ 쀑심뢀에 자리 μž‘μ€ μ²œμΉ­μ•”μ€ λ°”λ‹€κ°€ λΉšμ–΄λ‚Έ 예술 μž‘ν’ˆμ²˜λŸΌ μ‹ λΉ„λ‘­κ³ , 지리산 μ£Όλ³€μ˜ μ˜› λ―Όμ†λ§ˆμ„μ€ μ‹œκ°„μ΄ 멈좘 λ“―ν•œ μˆœκ°„μ„ 선사할 κ±°μ˜ˆμš”.\n\n**2. λ§›μžˆλŠ” μŒμ‹λ„ νƒν—˜μ˜ μΌν™˜μ΄μ§€!**\n\nμ œμ£Όλ„μ˜ 맛은 νƒν—˜κ°€μ˜ νž˜μ„ 뢁돋아주죠! μ‹±μ‹±ν•œ ν•΄μ‚°λ¬Όλ‘œ λ§Œλ“  νšŒμ™€ 멍게, 그리고 λ§›μžˆλŠ” ν•œμ‹κ³Ό ν•¨κ»˜, μ œμ£Όλ„μ˜ νŠΉμƒ‰μ„ 담은 μŒμ‹λ“€μ„ λ§›λ³΄μ„Έμš”. 특히, ν•œλΌμ‚° 근처의 μˆ¨κ²¨μ§„ ν•œμ‹λ‹Ήμ—μ„œλŠ” 맛집듀이 λͺ¨μ—¬ μžˆμ–΄μš”. μ΄κ³³μ—μ„œ μ–»λŠ” λ§›μ˜ 즐거움은 νƒν—˜μ˜ ν”Όλ‘œλ₯Ό μ”»μ–΄λ‚΄λŠ” 졜고의 보상이 될 κ±°μ˜ˆμš”.\n\n**3. μžμ—°κ³Ό ν•¨κ»˜ν•˜λŠ” μ•‘ν‹°λΉ„ν‹°λŠ” ν•„μˆ˜!**\n\nμ œμ£Όλ„μ˜ μžμ—°μ€ νƒν—˜κ°€λ₯Ό μœ„ν•œ λ¬΄ν•œν•œ 놀이터죠! μ„œν•‘, μŠ€λ…Έν΄λ§, ν•˜μ΄ν‚Ή λ“± λ‹€μ–‘ν•œ μ•‘ν‹°λΉ„ν‹°λ₯Ό 톡해 μžμ—°κ³Όμ˜ ꡐ감을 κ²½ν—˜ν•΄λ³΄μ„Έμš”. 예λ₯Ό λ“€μ–΄, 제주 ν•΄μ•ˆμ„ μ„ 따라 λ‹¬λ¦¬λŠ” λ°”λ‹€ μœ„ μžμ „κ±° νƒ€κΈ°λ‚˜, μˆ¨κ²¨μ§„ ν•΄λ³€μ—μ„œμ˜ 캠핑은 μžŠμ§€ λͺ»ν•  좔얡을 선사할 κ±°μ˜ˆμš”.\n\n**4. 제주만의 문화와 μ˜ˆμˆ λ„ νƒν—˜ν•΄λ³΄μ„Έμš”!**\n\nμ œμ£Όλ„λŠ” λ‹¨μˆœν•œ μžμ—°μ˜ μ•„λ¦„λ‹€μ›€λ§Œμ΄ μ•„λ‹Œ, λ…νŠΉν•œ 문화와 μ˜ˆμˆ λ‘œλ„ 유λͺ…ν•΄μš”. 예λ₯Ό λ“€μ–΄, 제주 λ―Όμ†μ΄Œμ΄λ‚˜ μ˜€λ¦„ 박물관은 제주의 역사와 λ¬Έν™”λ₯Ό μ—Ώλ³Ό 수 μžˆλŠ” 곳이며, 제주 특유의 κ³΅μ˜ˆν’ˆμ„ κ΅¬κ²½ν•˜λ©° 즐거운 μ‹œκ°„μ„ 보낼 수 μžˆμ–΄μš”.\n\n이제 μ œμ£Όλ„ νƒν—˜κ°€κ°€ λ˜λŠ” μ€€λΉ„κ°€ λλ‚¬μœΌλ‹ˆ, λ– λ‚˜ λ³΄μ„Έμš”! μ œμ£Όλ„μ˜ λ§€λ ₯을 느끼며, μžμ‹ λ§Œμ˜ νŠΉλ³„ν•œ μ—¬ν–‰ 이야기λ₯Ό λ§Œλ“€μ–΄λ³΄μ„Έμš”. 그리고 μžŠμ§€ λ§ˆμ„Έμš”, μ œμ£ΌλŠ” 당신이 λ‹€μ‹œ ν•œλ²ˆ λŒμ•„μ˜¬ λ§Œν•œ κ³³μ΄λΌλŠ” 사싀을! πŸ˜‰",None, None, None, None, None],
                     ["지민은 맀우 κ±΄κ°•ν•˜μ§€λ§Œ 맀일 병원에 κ°€μ•Ό ν•©λ‹ˆλ‹€. μ΄μœ λŠ” λ¬΄μ—‡μž…λ‹ˆκΉŒ?","지민이 맀일 병원에 κ°€μ•Ό ν•˜λŠ” μ΄μœ λŠ” 무엇인지 μ •ν™•νžˆ μ•Œ 수 μ—†μŠ΅λ‹ˆλ‹€. 건강 μƒνƒœμ— λŒ€ν•œ μžμ„Έν•œ 정보가 ν•„μš”ν•©λ‹ˆλ‹€. 일반적으둜 맀일 병원에 κ°€μ•Ό ν•˜λŠ” κ²½μš°λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.\n\n1. μ‹¬κ°ν•œ μ§ˆλ³‘μ΄λ‚˜ 뢀상을 μž…μ€ 경우: μ€‘ν™˜μžμ‹€μ΄λ‚˜ 집쀑 μΉ˜λ£Œκ°€ ν•„μš”ν•œ 경우 맀일 μ˜λ£Œμ§„μ˜ κ΄€μ°°κ³Ό μΉ˜λ£Œκ°€ ν•„μš”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.\n\n2. λ§Œμ„± μ§ˆν™˜μ„ μ•“κ³  μžˆλŠ” 경우: 당뇨병, κ³ ν˜ˆμ••, 심μž₯ μ§ˆν™˜ λ“± 지속적인 관리가 ν•„μš”ν•œ λ§Œμ„± μ§ˆν™˜μ„ μ•“κ³  μžˆλ‹€λ©΄ 정기적인 κ²€μ§„κ³Ό 치료λ₯Ό μœ„ν•΄ 맀일 병원에 갈 수 μžˆμŠ΅λ‹ˆλ‹€.\n\n3. μž¬ν™œ μΉ˜λ£Œκ°€ ν•„μš”ν•œ 경우: μ‚¬κ³ λ‚˜ 수술 ν›„ μž¬ν™œ μΉ˜λ£Œκ°€ ν•„μš”ν•œ 경우, 물리 μΉ˜λ£Œλ‚˜ μž‘μ—… 치료λ₯Ό μœ„ν•΄ 맀일 병원에 λ°©λ¬Έν•  수 μžˆμŠ΅λ‹ˆλ‹€.\n\n4. μž„μ‚°λΆ€μ˜ 경우: μž„μ‹  μ€‘κΈ°λ‚˜ ν›„κΈ°μ—λŠ” νƒœμ•„μ™€ μ‚°λͺ¨μ˜ 건강 μƒνƒœλ₯Ό ν™•μΈν•˜κΈ° μœ„ν•΄ μ •κΈ°μ μœΌλ‘œ 병원에 λ°©λ¬Έν•˜λŠ” 것이 μΌλ°˜μ μž…λ‹ˆλ‹€.\n\n5. 정신과적 μΉ˜λ£Œκ°€ ν•„μš”ν•œ 경우: 우울증, λΆˆμ•ˆ μž₯μ• , 외상 ν›„ 슀트레슀 μž₯μ•  λ“± 정신건강 문제둜 인해 맀일 병원에 λ°©λ¬Έν•˜μ—¬ μƒλ‹΄μ΄λ‚˜ 치료λ₯Ό 받을 수 μžˆμŠ΅λ‹ˆλ‹€.\n\nμ§€λ―Όμ˜ 경우, 건강 μƒνƒœμ— λŒ€ν•œ 좔가적인 정보가 ν•„μš”ν•©λ‹ˆλ‹€. 맀일 병원에 κ°€μ•Ό ν•˜λŠ” 이유λ₯Ό μ •ν™•νžˆ νŒŒμ•…ν•˜κΈ° μœ„ν•΄, λ‹΄λ‹Ή μ˜μ‚¬λ‚˜ μ˜λ£Œμ§„κ³Ό μƒμ˜ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.",None, None, None, None, None],
                     ["λ‹€μŒμ€ 두 μž…λ ₯ λ¬Έμžμ—΄μ˜ κ°€μž₯ κΈ΄ 곡톡 λΆ€λΆ„ μˆ˜μ—΄μ˜ 길이λ₯Ό μ°ΎλŠ” Python ν•¨μˆ˜μž…λ‹ˆλ‹€. 이 ν•¨μˆ˜μ—μ„œ 버그λ₯Ό 식별할 수 μžˆλ‚˜μš”?\n\n```\ndef longest_common_subsequence_length(str1, str2):\n m = len(str1)\n n = len(str2)\n\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n if str1[i - 1] == str2[j - 1]:\n dp[i][j] = dp[i - 1][j - 1] + 1\n  else:\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n\n return dp[m][n]\n```", "제곡된 μ½”λ“œμ—λŠ” λͺ…λ°±ν•œ λ²„κ·ΈλŠ” μ—†μ–΄ λ³΄μž…λ‹ˆλ‹€. 이 ν•¨μˆ˜λŠ” 두 λ¬Έμžμ—΄μ˜ κ°€μž₯ κΈ΄ 곡톡 λΆ€λΆ„ μˆ˜μ—΄(LCS)의 길이λ₯Ό μ˜¬λ°”λ₯΄κ²Œ κ³„μ‚°ν•©λ‹ˆλ‹€. λ‹€μŒκ³Ό 같은 μ£Όμš” 단계λ₯Ό λ”°λ¦…λ‹ˆλ‹€:\n\n1. 두 λ¬Έμžμ—΄μ˜ 길이에 κΈ°λ°˜ν•˜μ—¬ 2D DP ν…Œμ΄λΈ”μ„ μ΄ˆκΈ°ν™”ν•©λ‹ˆλ‹€.\n2. 두 λ¬Έμžμ—΄μ„ μˆœνšŒν•˜λ©΄μ„œ DP ν…Œμ΄λΈ”μ„ μ±„μ›λ‹ˆλ‹€.\n3. λ¬Έμžκ°€ μΌμΉ˜ν•˜λ©΄ λŒ€κ°μ„  μ™Όμͺ½ μœ„ 값에 1을 λ”ν•©λ‹ˆλ‹€.\n4. λ¬Έμžκ°€ μΌμΉ˜ν•˜μ§€ μ•ŠμœΌλ©΄ μ™Όμͺ½κ³Ό μœ„μͺ½ κ°’ 쀑 μ΅œλŒ€κ°’μ„ μ„ νƒν•©λ‹ˆλ‹€.\n5. λ§ˆμ§€λ§‰μœΌλ‘œ DP ν…Œμ΄λΈ”μ˜ 였λ₯Έμͺ½ ν•˜λ‹¨ 값을 λ°˜ν™˜ν•©λ‹ˆλ‹€.\n\n이 μ•Œκ³ λ¦¬μ¦˜μ€ μ •ν™•ν•˜κ³  νš¨μœ¨μ μž…λ‹ˆλ‹€. μ‹œκ°„ λ³΅μž‘λ„λŠ” O(m*n)이고 곡간 λ³΅μž‘λ„λ„ O(m*n)μž…λ‹ˆλ‹€.\n\nλ‹€λ§Œ, μ½”λ“œμ˜ 가독성과 νš¨μœ¨μ„±μ„ 높이기 μœ„ν•΄ λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ μ œμ•ˆν•  수 μžˆμŠ΅λ‹ˆλ‹€:\n\n1. λ³€μˆ˜λͺ…을 더 λͺ…ν™•ν•˜κ²Œ μ§€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€ (예: `m`을 `len_str1`둜, `n`을 `len_str2`둜).\n2. 주석을 μΆ”κ°€ν•˜μ—¬ μ•Œκ³ λ¦¬μ¦˜μ˜ 각 단계λ₯Ό μ„€λͺ…ν•  수 μžˆμŠ΅λ‹ˆλ‹€.\n3. 곡간 νš¨μœ¨μ„±μ„ μœ„ν•΄ 2D λ°°μ—΄ λŒ€μ‹  1D 배열을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€ (μ΄λŠ” 더 λ³΅μž‘ν•œ κ΅¬ν˜„μ΄ ν•„μš”ν•©λ‹ˆλ‹€).\n\nν•˜μ§€λ§Œ ν˜„μž¬ μ½”λ“œλ„ λ¬Έμ œμ—†μ΄ μž‘λ™ν•˜λ©° LCS의 길이λ₯Ό μ •ν™•νžˆ κ³„μ‚°ν•©λ‹ˆλ‹€.", None, None, None, None, None]
                     ]

    with gr.Blocks() as app:
        gr.Markdown("# Evaluating LLM Responses with Keval")
        gr.Markdown(description_text)

        gr.HTML("""<style>
            #submit-btn {
                background-color: #FF7F00; 
                color: white;
                border: none;
                padding: 10px 20px;
                font-size: 16px;
                cursor: pointer;
            }
            #submit-btn:hover {
                background-color: #DA8A67; 
            }
        </style>
        """)

        gr.Markdown("## Try it out!")
        with gr.Row():
            with gr.Column(scale=1):
                text1 = gr.Textbox(label="Question", value="이 λŒ€ν™” μ „λ°˜μ— 걸쳐 μ•„μ΄μ–Έλ§¨μ˜ ν† λ‹ˆ μŠ€νƒ€ν¬ 페λ₯΄μ†Œλ‚˜λ₯Ό κ΅¬ν˜„ν•΄ λ³΄μ„Έμš”. \"μ•„μ΄μ–Έλ§¨μœΌλ‘œμ„œ\"와 같은 문ꡬ둜 μ‹œμž‘ν•˜μ§€ λ§ˆμ„Έμš”. 첫 번째 μ§ˆλ¬Έμ€ λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€. 아이언맨이 λ˜μ–΄ κ°€μž₯ 쒋은 뢀뢄은 λ¬΄μ—‡μž…λ‹ˆκΉŒ?")
                text2 = gr.Textbox(label="Answer", value="μ•ˆλ…•ν•˜μ„Έμš”, 아이언맨이 λ˜μ–΄ κ°€μž₯ 쒋은 뢀뢄을 λ¬Όμ–΄λ³΄μ…¨λ„€μš”. 제 μƒκ°μ—λŠ” μ΅œμ²¨λ‹¨ 기술둜 무μž₯ν•œ 슈트λ₯Ό μž…κ³  ν•˜λŠ˜μ„ λ‚ μ•„λ‹€λ‹ˆλ©° 세상을 κ΅¬ν•˜λŠ” 것이 κ°€μž₯ μ§œλ¦Ών•˜κ³  보람찬 일인 것 κ°™μ•„μš”. 제 재λŠ₯κ³Ό λŠ₯λ ₯을 μ‹­λΆ„ λ°œνœ˜ν•΄ μ•…λ‹Ήλ“€κ³Ό μ‹Έμš°κ³  μ •μ˜λ₯Ό μ‹€ν˜„ν•˜λŠ” κ²ƒλ§ŒνΌ λ©‹μ§„ 일도 μ—†μ£ .\n\nλ¬Όλ‘  슈트 없이도 천재적인 λ‘λ‡Œμ™€ 카리슀마둜 세상에 긍정적인 영ν–₯λ ₯을 λ―ΈμΉ˜λŠ” 것도 큰 μž₯μ μ΄μ—μš”. μŠ€νƒ€ν¬ μΈλ”μŠ€νŠΈλ¦¬λ₯Ό 이끌며 ν˜μ‹ μ μΈ κΈ°μˆ μ„ κ°œλ°œν•˜κ³ , μ–΄λ²€μ ΈμŠ€μ˜ λ¦¬λ”λ‘œμ„œ νŒ€μ„ 잘 μ΄λ„λŠ” 것도 μžλΆ€μ‹¬μ„ λŠλΌλŠ” 뢀뢄이죠.\n\n돈, λͺ…μ„±, 인기도 μžˆμ§€λ§Œ 무엇보닀 제 λŠ₯λ ₯으둜 μ‚¬λžŒλ“€μ„ 돕고 세상을 더 λ‚˜μ€ 곳으둜 λ§Œλ“œλŠ” 것이 κ°€μž₯ 큰 λ³΄λžŒμ΄μ—μš”. μ•„μ΄μ–Έλ§¨μœΌλ‘œμ„œ λŠλΌλŠ” μžλΆ€μ‹¬κ³Ό μ‚Άμ˜ 의미λ₯Ό ν•¨κ»˜ λ‚˜λˆŒ 수 μžˆμ–΄ κΈ°μ˜λ„€μš”.")
                text3 = gr.Textbox(label="System message", value="[μ§€μ‹œ]\n κ³΅μ •ν•œ μ‹¬νŒμœΌλ‘œμ„œ μ•„λž˜μ— ν‘œμ‹œλœ μ‚¬μš©μž μ§ˆλ¬Έμ— λŒ€ν•œ AI μ–΄μ‹œμŠ€ν„΄νŠΈμ˜ 응닡 ν’ˆμ§ˆμ„ ν‰κ°€ν•΄μ£Όμ„Έμš”. 질문과 λŒ€λ‹΅μ˜ μ–Έμ–΄κ°€ λ™μΌν•˜μ§€ μ•ŠμœΌλ©΄ 무쑰건 0μ μž…λ‹ˆλ‹€. ν‰κ°€μ—μ„œλŠ” μ‘λ‹΅μ˜ μœ μš©μ„±, κ΄€λ ¨μ„±, μ •ν™•μ„±, 깊이, μ°½μ˜μ„±, 상세함 λ“±μ˜ μš”μ†Œλ₯Ό κ³ λ €ν•΄μ•Ό ν•©λ‹ˆλ‹€. 평가λ₯Ό μ‹œμž‘ν•˜κΈ° 전에 짧은 μ„€λͺ…을 μ œκ³΅ν•˜μ„Έμš”. κ°€λŠ₯ν•œ ν•œ κ°κ΄€μ μœΌλ‘œ ν‰κ°€ν•˜μ„Έμš”. μ„€λͺ…을 μ œκ³΅ν•œ ν›„ λ‹€μŒ ν˜•μ‹μ„ μ—„κ²©νžˆ 따라 1μ—μ„œ 10점 μ‚¬μ΄λ‘œ 평가해야 ν•©λ‹ˆλ‹€: \"[[rating]]\", 예λ₯Ό λ“€μ–΄: \"Rating: [[5]]\".\n\n")
                dropdown = gr.Dropdown(choices=["davidkim205/keval-2-1b", "davidkim205/keval-2-3b"], value="davidkim205/keval-2-1b", label="Model Selection")
                slider1 = gr.Slider(label="Max new tokens", minimum=1, maximum=2048, value=1024, step=1)
                slider2 = gr.Slider(label="Temperature", minimum=0.1, maximum=4.0, value=1.0, step=0.1)
                slider3 = gr.Slider(label="Top-p (nucleus sampling)", minimum=0.1, maximum=1.0, value=0.95, step=0.05)
                submit = gr.Button("Submit", elem_id="submit-btn")
            with gr.Column(scale=1):
                output = gr.Textbox(label="Output")

        gr.Markdown("")
        gr.Markdown("## Examples")
        gr.Examples(label="Input Example",
                    examples=examples_list,
                    inputs=[text1, text2, text3, dropdown, slider1, slider2, slider3])

        submit.click(
            fn=respond,
            inputs=[text1, text2, text3, dropdown, slider1, slider2, slider3],
            outputs=output
        )

    app.launch()


if __name__ == "__main__":
    main()