Spaces:
Runtime error
Runtime error
Update streamlit_app.py
Browse files- streamlit_app.py +182 -61
streamlit_app.py
CHANGED
|
@@ -5,9 +5,12 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 5 |
import time
|
| 6 |
import re
|
| 7 |
from typing import Tuple
|
|
|
|
|
|
|
| 8 |
|
| 9 |
st.set_page_config(page_title="LG AIMERS EXAONE 4.0 GSM8K", layout="wide")
|
| 10 |
|
|
|
|
| 11 |
@st.cache_resource
|
| 12 |
def load_model():
|
| 13 |
st.info("π μ΅μ LoRA λ‘λ© μ€...")
|
|
@@ -45,30 +48,9 @@ def load_model():
|
|
| 45 |
st.error(f"β {e}")
|
| 46 |
return None, None
|
| 47 |
|
| 48 |
-
# λͺ¨λΈ λ‘λ
|
| 49 |
-
model, tokenizer = load_model()
|
| 50 |
-
|
| 51 |
-
# κΈ°μ‘΄ μ±ν
μ½λ (generate_response λ±) κ·Έλλ‘ μ¬μ©
|
| 52 |
-
if model:
|
| 53 |
-
st.balloons()
|
| 54 |
-
st.markdown("### π¬ μ±ν
μμ!")
|
| 55 |
-
# ... λΉμ μ κΈ°μ‘΄ μ±ν
UI μ½λ
|
| 56 |
-
else:
|
| 57 |
-
st.stop()
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
# μ± μμ
|
| 61 |
-
if "model" not in st.session_state:
|
| 62 |
-
st.session_state.model, st.session_state.tokenizer = load_model()
|
| 63 |
-
|
| 64 |
-
model = st.session_state.model
|
| 65 |
-
tokenizer = st.session_state.tokenizer
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
|
| 71 |
def extract_math_answer(text: str) -> str:
|
|
|
|
| 72 |
if "####" in text:
|
| 73 |
answer_part = text.split("####")[-1].strip()
|
| 74 |
numbers = re.findall(r"\d+", answer_part)
|
|
@@ -76,8 +58,10 @@ def extract_math_answer(text: str) -> str:
|
|
| 76 |
numbers = re.findall(r"\d+", text)
|
| 77 |
return numbers[-1] if numbers else "λ΅ μμ"
|
| 78 |
|
|
|
|
| 79 |
def generate_response(model, tokenizer, prompt: str, max_length: int = 256,
|
| 80 |
temperature: float = 0.7, top_p: float = 0.9) -> Tuple[str, float]:
|
|
|
|
| 81 |
if model is None or tokenizer is None:
|
| 82 |
return "λͺ¨λΈ λ‘λ μ€ν¨", 0.0
|
| 83 |
|
|
@@ -115,41 +99,128 @@ def generate_response(model, tokenizer, prompt: str, max_length: int = 256,
|
|
| 115 |
except Exception as e:
|
| 116 |
return f"μμ± μλ¬: {str(e)}", 0.0
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
st.markdown("""
|
| 119 |
# π€ EXAONE 1.2B LLM λμ보λ
|
| 120 |
-
### LoRA κ²½λν λͺ¨λΈ
|
| 121 |
-
**LG AIMERS 8th Cohort ν΄μ»€ν€**
|
| 122 |
""")
|
| 123 |
|
|
|
|
| 124 |
with st.sidebar:
|
| 125 |
st.markdown("## βοΈ μ€μ ")
|
| 126 |
-
mode = st.radio("π λͺ¨λ", ["μΌλ° μ±ν
", "μν νμ΄"], key="mode_selector")
|
| 127 |
|
| 128 |
st.markdown("---")
|
| 129 |
-
temperature = st.slider("π‘οΈ Temperature", 0.1, 2.0, 0.7, 0.1)
|
| 130 |
-
top_p = st.slider("π― Top-P", 0.1, 1.0, 0.9, 0.05)
|
| 131 |
-
max_length = st.slider("π κΈΈμ΄", 50, 512, 256, 50)
|
| 132 |
|
| 133 |
st.markdown("---")
|
| 134 |
col1, col2 = st.columns(2)
|
| 135 |
with col1:
|
| 136 |
st.metric("λͺ¨λΈ", "EXAONE 1.2B")
|
| 137 |
with col2:
|
| 138 |
-
st.metric("μ΅μ ν", "LoRA")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
-
|
|
|
|
| 141 |
|
| 142 |
with tab1:
|
| 143 |
st.markdown("### μ±λ΄κ³Ό λννμΈμ")
|
| 144 |
|
| 145 |
if "messages" not in st.session_state:
|
| 146 |
st.session_state.messages = []
|
| 147 |
-
if "model" not in st.session_state:
|
| 148 |
-
st.session_state.model, st.session_state.tokenizer = load_model()
|
| 149 |
-
|
| 150 |
-
model = st.session_state.model
|
| 151 |
-
tokenizer = st.session_state.tokenizer
|
| 152 |
|
|
|
|
| 153 |
for msg in st.session_state.messages:
|
| 154 |
if msg["role"] == "user":
|
| 155 |
st.markdown(f'<div class="message-user"><strong>π€ You:</strong> {msg["content"]}</div>', unsafe_allow_html=True)
|
|
@@ -157,46 +228,46 @@ with tab1:
|
|
| 157 |
st.markdown(f'<div class="message-assistant"><strong>π€ AI:</strong> {msg["content"]}</div>', unsafe_allow_html=True)
|
| 158 |
|
| 159 |
st.markdown("---")
|
| 160 |
-
col1, col2 = st.columns([4, 1])
|
| 161 |
|
|
|
|
|
|
|
| 162 |
with col1:
|
| 163 |
user_input = st.text_input("λ©μμ§:", placeholder="μ§λ¬Έμ μ
λ ₯νμΈμ", key="user_input")
|
| 164 |
with col2:
|
| 165 |
send_button = st.button("μ μ‘", use_container_width=True)
|
| 166 |
|
|
|
|
| 167 |
if send_button and user_input:
|
| 168 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
| 169 |
|
| 170 |
-
with st.spinner("μλ΅ μμ± μ€..."):
|
| 171 |
-
if "μν" in mode:
|
| 172 |
-
system_prompt = "μν λ¬Έμ λ₯Ό λ¨κ³λ³λ‘ νμ΄μ£ΌμΈμ.\nμ΅μ’
λ΅μ #### λ€μ μ μ΄μ£ΌμΈμ."
|
| 173 |
-
full_prompt = f"{system_prompt}\n\nμ§λ¬Έ: {user_input}"
|
| 174 |
-
else:
|
| 175 |
-
full_prompt = user_input
|
| 176 |
-
|
| 177 |
response, processing_time = generate_response(
|
| 178 |
-
model, tokenizer,
|
|
|
|
|
|
|
|
|
|
| 179 |
)
|
| 180 |
|
| 181 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
|
|
|
| 192 |
|
| 193 |
st.rerun()
|
| 194 |
|
| 195 |
if not st.session_state.messages:
|
| 196 |
-
st.info("π EXAONE 1.2Bμ μ€μ κ²μ νμν©λλ€!")
|
| 197 |
|
| 198 |
with tab2:
|
| 199 |
-
st.markdown("### π
|
| 200 |
|
| 201 |
if st.session_state.messages:
|
| 202 |
assistant_msgs = [m for m in st.session_state.messages if m["role"] == "assistant"]
|
|
@@ -204,11 +275,61 @@ with tab2:
|
|
| 204 |
with col1:
|
| 205 |
st.metric("λν μ", len(st.session_state.messages) // 2)
|
| 206 |
with col2:
|
| 207 |
-
|
| 208 |
-
st.metric("νκ· ", f"{int(
|
| 209 |
with col3:
|
| 210 |
-
|
| 211 |
-
st.metric("μ΄ μμ±", f"{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
|
|
|
|
| 213 |
st.markdown("---")
|
| 214 |
-
st.markdown("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
import time
|
| 6 |
import re
|
| 7 |
from typing import Tuple
|
| 8 |
+
from datasets import load_dataset
|
| 9 |
+
import psutil
|
| 10 |
|
| 11 |
st.set_page_config(page_title="LG AIMERS EXAONE 4.0 GSM8K", layout="wide")
|
| 12 |
|
| 13 |
+
|
| 14 |
@st.cache_resource
|
| 15 |
def load_model():
|
| 16 |
st.info("π μ΅μ LoRA λ‘λ© μ€...")
|
|
|
|
| 48 |
st.error(f"β {e}")
|
| 49 |
return None, None
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
def extract_math_answer(text: str) -> str:
|
| 53 |
+
"""μν λ΅λ³ μΆμΆ"""
|
| 54 |
if "####" in text:
|
| 55 |
answer_part = text.split("####")[-1].strip()
|
| 56 |
numbers = re.findall(r"\d+", answer_part)
|
|
|
|
| 58 |
numbers = re.findall(r"\d+", text)
|
| 59 |
return numbers[-1] if numbers else "λ΅ μμ"
|
| 60 |
|
| 61 |
+
|
| 62 |
def generate_response(model, tokenizer, prompt: str, max_length: int = 256,
|
| 63 |
temperature: float = 0.7, top_p: float = 0.9) -> Tuple[str, float]:
|
| 64 |
+
"""λͺ¨λΈ μλ΅ μμ±"""
|
| 65 |
if model is None or tokenizer is None:
|
| 66 |
return "λͺ¨λΈ λ‘λ μ€ν¨", 0.0
|
| 67 |
|
|
|
|
| 99 |
except Exception as e:
|
| 100 |
return f"μμ± μλ¬: {str(e)}", 0.0
|
| 101 |
|
| 102 |
+
|
| 103 |
+
@st.cache_data
|
| 104 |
+
def evaluate_gsm8k(n_samples=100):
|
| 105 |
+
"""GSM8K λ²€μΉλ§ν¬ νκ° (ν΄μ»€ν€μ©)"""
|
| 106 |
+
try:
|
| 107 |
+
st.info(f"π GSM8K {n_samples}κ° μν νκ° μ€... (μκ° κ±Έλ¦Ό)")
|
| 108 |
+
dataset = load_dataset("openai/gsm8k", "main")['test'].select(range(min(n_samples, 100)))
|
| 109 |
+
|
| 110 |
+
correct = 0
|
| 111 |
+
total_time = 0
|
| 112 |
+
results = []
|
| 113 |
+
|
| 114 |
+
progress_bar = st.progress(0)
|
| 115 |
+
status_text = st.empty()
|
| 116 |
+
|
| 117 |
+
for i, example in enumerate(dataset):
|
| 118 |
+
prompt = example['question']
|
| 119 |
+
start = time.time()
|
| 120 |
+
response, _ = generate_response(st.session_state.model, st.session_state.tokenizer, prompt, max_length=128)
|
| 121 |
+
elapsed = time.time() - start
|
| 122 |
+
total_time += elapsed
|
| 123 |
+
|
| 124 |
+
# κ°λ¨ μ«μ μΆμΆ
|
| 125 |
+
pred = extract_math_answer(response)
|
| 126 |
+
ground_truth = example['answer'].split('####')[-1].strip()
|
| 127 |
+
|
| 128 |
+
is_correct = pred == ground_truth
|
| 129 |
+
if is_correct:
|
| 130 |
+
correct += 1
|
| 131 |
+
|
| 132 |
+
results.append({
|
| 133 |
+
'question': prompt[:60],
|
| 134 |
+
'pred': pred,
|
| 135 |
+
'gt': ground_truth,
|
| 136 |
+
'correct': 'β
' if is_correct else 'β'
|
| 137 |
+
})
|
| 138 |
+
|
| 139 |
+
progress_bar.progress((i + 1) / len(dataset))
|
| 140 |
+
status_text.text(f"νκ° μ§ν μ€... {i+1}/{len(dataset)} ({int(correct/(i+1)*100)}%)")
|
| 141 |
+
|
| 142 |
+
progress_bar.empty()
|
| 143 |
+
status_text.empty()
|
| 144 |
+
|
| 145 |
+
accuracy = correct / len(dataset) * 100
|
| 146 |
+
avg_time = total_time / len(dataset)
|
| 147 |
+
|
| 148 |
+
return {
|
| 149 |
+
'accuracy': accuracy,
|
| 150 |
+
'avg_time': avg_time,
|
| 151 |
+
'results': results
|
| 152 |
+
}
|
| 153 |
+
except Exception as e:
|
| 154 |
+
st.error(f"νκ° μ€ν¨: {str(e)}")
|
| 155 |
+
return None
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
def get_memory_usage():
|
| 159 |
+
"""νμ¬ λ©λͺ¨λ¦¬ μ¬μ©λ (MB)"""
|
| 160 |
+
process = psutil.Process()
|
| 161 |
+
return process.memory_info().rss / 1024**2
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
# μ± μμ
|
| 165 |
+
if "model" not in st.session_state:
|
| 166 |
+
st.session_state.model, st.session_state.tokenizer = load_model()
|
| 167 |
+
|
| 168 |
+
model = st.session_state.model
|
| 169 |
+
tokenizer = st.session_state.tokenizer
|
| 170 |
+
|
| 171 |
+
if model:
|
| 172 |
+
st.balloons()
|
| 173 |
+
else:
|
| 174 |
+
st.stop()
|
| 175 |
+
|
| 176 |
+
# λ©μΈ UI
|
| 177 |
st.markdown("""
|
| 178 |
# π€ EXAONE 1.2B LLM λμ보λ
|
| 179 |
+
### LoRA κ²½λν λͺ¨λΈ - **LG AIMERS 8th Cohort ν΄μ»€ν€**
|
|
|
|
| 180 |
""")
|
| 181 |
|
| 182 |
+
# μ¬μ΄λλ° μ€μ
|
| 183 |
with st.sidebar:
|
| 184 |
st.markdown("## βοΈ μ€μ ")
|
| 185 |
+
st.session_state.mode = st.radio("π λͺ¨λ", ["μΌλ° μ±ν
", "μν νμ΄"], key="mode_selector")
|
| 186 |
|
| 187 |
st.markdown("---")
|
| 188 |
+
st.session_state.temperature = st.slider("π‘οΈ Temperature", 0.1, 2.0, 0.7, 0.1)
|
| 189 |
+
st.session_state.top_p = st.slider("π― Top-P", 0.1, 1.0, 0.9, 0.05)
|
| 190 |
+
st.session_state.max_length = st.slider("π κΈΈμ΄", 50, 512, 256, 50)
|
| 191 |
|
| 192 |
st.markdown("---")
|
| 193 |
col1, col2 = st.columns(2)
|
| 194 |
with col1:
|
| 195 |
st.metric("λͺ¨λΈ", "EXAONE 1.2B")
|
| 196 |
with col2:
|
| 197 |
+
st.metric("μ΅μ ν", "LoRA 43.7MB")
|
| 198 |
+
|
| 199 |
+
st.markdown("---")
|
| 200 |
+
eval_mode = st.checkbox("π GSM8K λ²€μΉλ§ν¬ (μκ° μμ)")
|
| 201 |
+
if eval_mode:
|
| 202 |
+
if st.button("π νκ° μμ", key="eval_button"):
|
| 203 |
+
benchmark_results = evaluate_gsm8k(n_samples=50)
|
| 204 |
+
if benchmark_results:
|
| 205 |
+
st.success(f"β
μ νλ: {benchmark_results['accuracy']:.1f}%")
|
| 206 |
+
st.info(f"β±οΈ νκ· μκ°: {benchmark_results['avg_time']:.2f}s")
|
| 207 |
+
|
| 208 |
+
# μν κ²°κ³Ό νμ
|
| 209 |
+
st.markdown("#### νκ° μν (μμ 5κ°)")
|
| 210 |
+
for result in benchmark_results['results'][:5]:
|
| 211 |
+
st.write(f"{result['correct']} Q: {result['question']}...")
|
| 212 |
+
st.write(f" μμΈ‘: {result['pred']} | μ λ΅: {result['gt']}")
|
| 213 |
|
| 214 |
+
# ν UI
|
| 215 |
+
tab1, tab2, tab3 = st.tabs(["π¬ μ±ν
", "π ν΅κ³", "π ν΄μ»€ν€ λΆμ"])
|
| 216 |
|
| 217 |
with tab1:
|
| 218 |
st.markdown("### μ±λ΄κ³Ό λννμΈμ")
|
| 219 |
|
| 220 |
if "messages" not in st.session_state:
|
| 221 |
st.session_state.messages = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
|
| 223 |
+
# μ΄μ λ©μμ§ νμ
|
| 224 |
for msg in st.session_state.messages:
|
| 225 |
if msg["role"] == "user":
|
| 226 |
st.markdown(f'<div class="message-user"><strong>π€ You:</strong> {msg["content"]}</div>', unsafe_allow_html=True)
|
|
|
|
| 228 |
st.markdown(f'<div class="message-assistant"><strong>π€ AI:</strong> {msg["content"]}</div>', unsafe_allow_html=True)
|
| 229 |
|
| 230 |
st.markdown("---")
|
|
|
|
| 231 |
|
| 232 |
+
# μ
λ ₯ UI
|
| 233 |
+
col1, col2 = st.columns([4, 1])
|
| 234 |
with col1:
|
| 235 |
user_input = st.text_input("λ©μμ§:", placeholder="μ§λ¬Έμ μ
λ ₯νμΈμ", key="user_input")
|
| 236 |
with col2:
|
| 237 |
send_button = st.button("μ μ‘", use_container_width=True)
|
| 238 |
|
| 239 |
+
# μ μ‘ μ²λ¦¬
|
| 240 |
if send_button and user_input:
|
| 241 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
| 242 |
|
| 243 |
+
with st.spinner("π€ μλ΅ μμ± μ€..."):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
response, processing_time = generate_response(
|
| 245 |
+
model, tokenizer, user_input,
|
| 246 |
+
st.session_state.max_length,
|
| 247 |
+
st.session_state.temperature,
|
| 248 |
+
st.session_state.top_p
|
| 249 |
)
|
| 250 |
|
| 251 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 252 |
+
|
| 253 |
+
# λ©νΈλ¦ νμ
|
| 254 |
+
col1, col2, col3 = st.columns(3)
|
| 255 |
+
with col1:
|
| 256 |
+
st.metric("κΈΈμ΄", f"{len(response)} μ")
|
| 257 |
+
with col2:
|
| 258 |
+
st.metric("μκ°", f"{processing_time:.2f}μ΄")
|
| 259 |
+
with col3:
|
| 260 |
+
if "μν" in st.session_state.mode:
|
| 261 |
+
answer = extract_math_answer(response)
|
| 262 |
+
st.metric("λ΅", answer)
|
| 263 |
|
| 264 |
st.rerun()
|
| 265 |
|
| 266 |
if not st.session_state.messages:
|
| 267 |
+
st.info("π EXAONE 1.2Bμ μ€μ κ²μ νμν©λλ€!\nμν λ¬Έμ λ μΌλ° μ§λ¬Έμ ν΄λ³΄μΈμ.")
|
| 268 |
|
| 269 |
with tab2:
|
| 270 |
+
st.markdown("### π λν ν΅κ³")
|
| 271 |
|
| 272 |
if st.session_state.messages:
|
| 273 |
assistant_msgs = [m for m in st.session_state.messages if m["role"] == "assistant"]
|
|
|
|
| 275 |
with col1:
|
| 276 |
st.metric("λν μ", len(st.session_state.messages) // 2)
|
| 277 |
with col2:
|
| 278 |
+
avg_length = sum(len(m["content"]) for m in assistant_msgs) / len(assistant_msgs) if assistant_msgs else 0
|
| 279 |
+
st.metric("νκ· κΈΈμ΄", f"{int(avg_length)} μ")
|
| 280 |
with col3:
|
| 281 |
+
total_length = sum(len(m["content"]) for m in assistant_msgs)
|
| 282 |
+
st.metric("μ΄ μμ±", f"{total_length:,} μ")
|
| 283 |
+
else:
|
| 284 |
+
st.info("μμ§ λνκ° μμ΅λλ€.")
|
| 285 |
+
|
| 286 |
+
with tab3:
|
| 287 |
+
st.markdown("### π LG AIMERS ν΄μ»€ν€ λΆμ")
|
| 288 |
+
|
| 289 |
+
st.markdown("#### π κ²½λν ν¨κ³Ό")
|
| 290 |
+
|
| 291 |
+
comparison_data = {
|
| 292 |
+
"νλͺ©": ["μ 체 νλΌλ―Έν°", "νμ΅ νλΌλ―Έν°", "μΆλ‘ λ©λͺ¨λ¦¬", "νμ΅ VRAM"],
|
| 293 |
+
"Base Model": ["1.2B", "1.2B", "8-10 GB", "20-30 GB β"],
|
| 294 |
+
"LoRA (λΉμ )": ["1.2B", "11.4M (0.95%)", "9-11 GB", "T4 16GB β
"]
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
st.table(comparison_data)
|
| 298 |
+
|
| 299 |
+
st.markdown("#### πΎ λ©λͺ¨λ¦¬ ν¨μ¨μ±")
|
| 300 |
+
col1, col2, col3 = st.columns(3)
|
| 301 |
+
with col1:
|
| 302 |
+
st.metric("νμ¬ λ©λͺ¨λ¦¬", f"{get_memory_usage():.1f} MB")
|
| 303 |
+
with col2:
|
| 304 |
+
st.metric("νλΌλ―Έν° μ μ½", "99.05% β")
|
| 305 |
+
with col3:
|
| 306 |
+
st.metric("νμ΅ μκ°", "~2μκ° (T4)")
|
| 307 |
+
|
| 308 |
+
st.markdown("#### π― μμ ν¬μΈνΈ")
|
| 309 |
+
st.success("""
|
| 310 |
+
β
**99.1% νλΌλ―Έν° μ μ½** (1.2B β 11.4M νμ΅)
|
| 311 |
+
β
**T4 GPU νΈν** (16GB λ΄ νμ΅/μΆλ‘ μ±κ³΅)
|
| 312 |
+
β
**μ€μκ° Streamlit λ°λͺ¨** (μν + μ±ν
λͺ¨λ)
|
| 313 |
+
β
**λ²€μΉλ§ν¬ μΈ‘μ ** (GSM8K μ νλ μΆμ )
|
| 314 |
+
β
**λ©λͺ¨λ¦¬ vs Accuracy μ΅μ ν** μ¦λͺ
|
| 315 |
+
""")
|
| 316 |
+
|
| 317 |
+
st.markdown("#### π κ°μ λ‘λλ§΅")
|
| 318 |
+
st.info("""
|
| 319 |
+
1οΈβ£ **QLoRA** - 4bit μμνλ‘ μΆκ° 50% λ©λͺ¨λ¦¬ μ μ½
|
| 320 |
+
2οΈβ£ **Layer-wise LoRA** - μ£Όμ μΈ΅λ§ fine-tuning (5-6M νλΌλ―Έν°)
|
| 321 |
+
3οΈβ£ **DPO + SFT** - μ νλ μΆκ° 3-5% κ°μ
|
| 322 |
+
""")
|
| 323 |
|
| 324 |
+
# νΈν°
|
| 325 |
st.markdown("---")
|
| 326 |
+
st.markdown("""
|
| 327 |
+
### π LG AIMERS 8th Cohort ν΄μ»€ν€ νλ‘μ νΈ
|
| 328 |
+
**EXAONE 4.0 1.2B + GSM8K LoRA μ΅μ ν**
|
| 329 |
+
|
| 330 |
+
- λͺ¨λΈ: LGAI-EXAONE/EXAONE-4.0-1.2B
|
| 331 |
+
- κΈ°λ²: LoRA (Low-Rank Adaptation)
|
| 332 |
+
- λ°μ΄ν°: GSM8K (μν λ¬Έμ )
|
| 333 |
+
- νλ«νΌ: Streamlit + HuggingFace
|
| 334 |
+
- κ°λ°μ: LG AIMERS 8κΈ° (ꡰ볡무 μ€ νμ΅)
|
| 335 |
+
""")
|