crimson-red-sky / app.py
reshinthadith's picture
Update app.py
ac2194c
raw
history blame
665 Bytes
import streamlit as st
from datasets import load_dataset
dataset = load_dataset("reshinthadith/pairwise-code-review-instruct-critique-revision-python")
total_length = len(dataset["train"])
st.title('Pairwise Comparison')
with st.form("dataset_form"):
len_index = st.slider('Dataset Index', 0, total_length,0)
if st.form_submit_button("Load"):
st.markdown("## Question")
st.text(dataset["train"]["prompt"][len_index])
st.markdown("## Chosen")
st.text(dataset["train"]["chosen"][len_index].split("Critique")[1])
st.markdown("## Rejected")
st.text(dataset["train"]["rejected"][len_index].split("Critique")[1])