PyStreamGPT / app.py
Saboorhsn's picture
Update app.py
c7cc986 verified
raw
history blame
936 Bytes
import streamlit as st
from datasets import load_dataset, concatenate_datasets
def load_and_combine_datasets():
# Load the datasets
python_codes_dataset = load_dataset('flytech/python-codes-25k', split='train')
streamlit_issues_dataset = load_dataset("andfanilo/streamlit-issues")
streamlit_docs_dataset = load_dataset("sai-lohith/streamlit_docs")
# Combine the datasets
combined_dataset = concatenate_datasets([python_codes_dataset, streamlit_issues_dataset, streamlit_docs_dataset])
return combined_dataset
def main():
st.title("Combined Dataset Viewer")
# Load and combine datasets
combined_dataset = load_and_combine_datasets()
# Display random sample from the combined dataset
random_sample = combined_dataset.shuffle(seed=42).select(range(10))
st.header("Random Sample from Combined Dataset")
st.write(random_sample)
if __name__ == "__main__":
main()