import time from streamlit.deltagenerator import DeltaGenerator import streamlit as st…
- User
import time from streamlit.delta_generator import DeltaGenerator import streamlit as st import os,sys import importlib.util import inspect
#from here https://github.com/harahu/st-clean-slate-rendering/blob/main/__main__.py def get_clean_rendering_container() -> DeltaGenerator: """Makes sure we can render from a clean slate on state changes.""" slot_in_use = st.session_state.get("slot_in_use", "initial")
# Use slot 'a' initially, then cycle through 'b' and 'c'. if slot_in_use == "initial": slot_in_use = st.session_state.slot_in_use = "a" elif slot_in_use == "a": slot_in_use = st.session_state.slot_in_use = "b" elif slot_in_use == "b": slot_in_use = st.session_state.slot_in_use = "c" else: # if slot_in_use == "c": slot_in_use = st.session_state.slot_in_use = "b" slot = { "a": st.empty(), "b": st.empty(), "c": st.empty(), }[slot_in_use] return slot.container()from comparesite_models import models_funcs
def list_models(): function_dict = {} for name, obj in inspect.getmembers(models_funcs): if inspect.isfunction(obj): function_dict[name] = obj return function_dict
@st.cache_data(show_spinner=True,ttl=15) def get_model_response(model_choice, message): return modelsmodel_choice
st.set_page_config( page_title="NeurocoderTestEnv", page_icon="🧊", layout="wide",
)
st.subheader("📊 Neurocoder Model compare") #st.caption("🚀 A streamlit chatbot powered by OpenAI LLM") if "messages0" not in st.session_state: st.session_state["messages0"] = [{"role": "assistant", "content": "How can I help you?"}] if "messages1" not in st.session_state: st.session_state["messages1"] = [{"role": "assistant", "content": "How can I help you?"}] if "messages2" not in st.session_state: st.session_state["messages2"] = [{"role": "assistant", "content": "How can I help you?"}] if "lastquery" not in st.session_state: st.session_state["lastquery"] = None
models = list_models()
columns = st.columns(3) model_choice = [None,None,None] empties = [] with st.container(): with columns[0]: # Create a Streamlit selectbox with the model names model_choice[0] = st.selectbox( 'Choose a model 0:', models )
st.write(f"You selected: {model_choice[0]}") with columns[1]: # Create a Streamlit selectbox with the model names model_choice[1] = st.selectbox( 'Choose a model 1:', models, index=1 ) st.write(f"You selected: {model_choice[1]}") with columns[2]: # Create a Streamlit selectbox with the model names model_choice[2] = st.selectbox( 'Choose a model 2:', models, index=2 ) st.write(f"You selected: {model_choice[2]}") - Assistant
Thank you for using the Neurocoder Model compare app!
- User
- Assistant
- User
объясни почему ошибка ModuleNotFoundError: No module named 'tiktoken'
- Assistant
The error message "ModuleNotFoundError: No module named 'tiktoken'" occurs because the module
tiktokenis not installed in your Python environment. The code you provided in your previous message does not contain any import statement for thetiktokenmodule.To resolve this error, you need to install the
tiktokenmodule using the following command in your terminal or command prompt:pip install tiktokenMake sure you have an active internet connection and the correct Python environment selected when running the command. Once the installation is complete, you should be able to import the
tiktokenmodule without any errors. - User
ModuleNotFoundError: No module named 'sentence_transformers'
- Assistant
The error message "ModuleNotFoundError: No module named 'sentence_transformers'" occurs because the module
sentence_transformersis not installed in your Python environment. The code you provided in your previous message does not contain any import statement for thesentence_transformersmodule.To resolve this error, you need to install the
sentence_transformersmodule using the following command in your terminal or command prompt:pip install sentence-transformersMake sure you have an active internet connection and the correct Python environment selected when running the command. Once the installation is complete, you should be able to import the
sentence_transformersmodule without any errors.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.