Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,30 @@ from latex_formatter import LatexFormatter # LaTeX 포맷터 import
|
|
| 10 |
logging.basicConfig(level=logging.DEBUG)
|
| 11 |
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# Streamlit 페이지 기본 설정
|
| 14 |
st.set_page_config(
|
| 15 |
page_title="MisconcepTutor",
|
|
|
|
| 10 |
logging.basicConfig(level=logging.DEBUG)
|
| 11 |
|
| 12 |
|
| 13 |
+
from src.FirstModule.module1 import MisconceptionModel
|
| 14 |
+
|
| 15 |
+
# Initialize Misconception Model
|
| 16 |
+
@st.cache_resource
|
| 17 |
+
def load_misconception_model():
|
| 18 |
+
return MisconceptionModel(
|
| 19 |
+
model_name="minsuas/Misconceptions__1",
|
| 20 |
+
misconception_mapping_path=os.path.join(data_path, 'misconception_mapping.parquet'),
|
| 21 |
+
misconception_embs_paths=[os.path.join(data_path, f'embs_misconception-9.npy')]
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
# Example integration
|
| 25 |
+
def start_quiz_with_predictions():
|
| 26 |
+
model = load_misconception_model()
|
| 27 |
+
df = load_data()
|
| 28 |
+
if df is None or df.empty:
|
| 29 |
+
st.error("데이터를 불러올 수 없습니다.")
|
| 30 |
+
return
|
| 31 |
+
df = model.preprocess(df)
|
| 32 |
+
predictions = model.predict(df)
|
| 33 |
+
st.session_state.questions = predictions.sample(n=10, random_state=42)
|
| 34 |
+
st.session_state.current_step = 'quiz'
|
| 35 |
+
|
| 36 |
+
|
| 37 |
# Streamlit 페이지 기본 설정
|
| 38 |
st.set_page_config(
|
| 39 |
page_title="MisconcepTutor",
|