|
|
|
|
|
import os |
|
|
from pathlib import Path |
|
|
import streamlit as st |
|
|
|
|
|
|
|
|
def init_session_state(): |
|
|
if 'bot_status' not in st.session_state: |
|
|
st.session_state.bot_status = "Arrêté" |
|
|
if 'server_status' not in st.session_state: |
|
|
st.session_state.server_status = "Inactif" |
|
|
if 'total_qa_pairs' not in st.session_state: |
|
|
st.session_state.total_qa_pairs = 0 |
|
|
if 'logs' not in st.session_state: |
|
|
st.session_state.logs = [] |
|
|
if 'qa_data' not in st.session_state: |
|
|
st.session_state.qa_data = [] |
|
|
if 'enable_enrichment' not in st.session_state: |
|
|
st.session_state.enable_enrichment = True |
|
|
if 'min_relevance' not in st.session_state: |
|
|
st.session_state.min_relevance = 70 |
|
|
if 'num_queries' not in st.session_state: |
|
|
st.session_state.num_queries = 5 |
|
|
if 'temperature' not in st.session_state: |
|
|
st.session_state.temperature = 0.7 |
|
|
if 'n_predict' not in st.session_state: |
|
|
st.session_state.n_predict = 512 |
|
|
|
|
|
REQUEST_COUNT = 0 |
|
|
MAX_REQUESTS_BEFORE_PAUSE = 15 |
|
|
MIN_PAUSE = 2 |
|
|
MAX_PAUSE = 5 |
|
|
LLM_SERVER_URL = "http://localhost:8080/completion" |
|
|
USE_API_KEYS = True |
|
|
|