File size: 1,584 Bytes
b977b5a
fd23c3d
5106b32
 
b977b5a
fd23c3d
 
 
b977b5a
fd23c3d
 
 
 
 
 
b2b5d47
fd23c3d
 
 
ff168b2
fd23c3d
0d98fd6
 
ff168b2
 
 
 
b2b5d47
fd23c3d
b2b5d47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st
from datasets import load_dataset
import pandas as pd


def test_v01():
    # adding the text that will show in the text box as default
    default_value = "See how a modern neural network auto-completes your text πŸ€— This site, built by the    Hugging Face team, lets you write a whole document directly from your browser, and you can trigger the Transformer anywhere using the Tab key. Its like having a smart machine that completes your thoughts πŸ˜€ Get started by typing a custom snippet, check out the repository, or try one of the examples. Have fun!"

    sent = st.text_area("Text", default_value, height = 275)
    max_length = st.sidebar.slider("Max Length", min_value = 10, max_value=30)
    temperature = st.sidebar.slider("Temperature", value = 1.0, min_value = 0.0, max_value=1.0, step=0.05)
    top_k = st.sidebar.slider("Top-k", min_value = 0, max_value=5, value = 0)
    top_p = st.sidebar.slider("Top-p", min_value = 0.0, max_value=1.0, step = 0.05, value = 0.9)
    num_return_sequences = st.sidebar.number_input('Number of Return Sequences', min_value=1, max_value=5, value=1, step=1)
    return num_return_sequences

def test_v02():
    dataset = load_dataset("merve/poetry", streaming=True)
    print(dataset)
    df = pd.DataFrame.from_dict(dataset["train"])
    st.write("Most appearing words including stopwords")
    # st.bar_chart(words[0:50])
    # st.write("Number of poems for each author")
    # sns.catplot(x="author", data=df, kind="count", aspect = 4)
    # plt.xticks(rotation=90)
    # st.pyplot()
    return st

test_v02()