import streamlit as st from evaluator import evaluator st.title('Natural Language Explanation Demo') model_name = st.selectbox('Select a model:', ['gpt4-1106', 'gpt35-1106']) question = st.text_input('Enter question:', '') explaination = st.text_input('Enter explanation:', '') if st.button('Evaluate Explanation'): # print the question and explanation st.write('### Question') st.write(question) st.write('### Explanation') st.write(explaination) # Evaluate the question and expl if question and explaination: eval = evaluator(model_name) scores = eval(question,explaination) # You need to handle the model logic st.write('### Scores') for principle, score in scores.items(): st.write(f"{principle}: {score}") else: st.write('Please enter question and explanation to evaluate')