File size: 750 Bytes
8ff7540
 
 
 
d0962d2
8ff7540
 
 
 
 
 
7c686e3
8ff7540
3273fee
 
 
 
 
8ff7540
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
import streamlit as st
from huggingface_hub import Repository

repo = Repository(
    local_dir="scripts",
    repo_type="model",
    clone_from="stistko/CzechPunctuationKapitalizationBART",
    token=True
)
repo.git_pull()

from scripts.model import Model

@st.cache_resource
def get_model():
    return Model()

model = get_model()

st.write("""
# Czech Punctuation and Capitalization Model (CPCM)
This application uses a transformer model 'BART-small' with subsequent fine-tuning and a contextual window of 300 tokens.
""")

# Text input field
input_text = st.text_input("Enter text here:")

# Button for submission
submit_button = st.button("Submit")

# Action after button press
if submit_button:
    st.write(f"Output: {model.run(input_text)}")