mpolacek commited on
Commit
8ff7540
·
1 Parent(s): d0b1649
Files changed (1) hide show
  1. app.py +29 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from huggingface_hub import Repository
3
+
4
+ repo = Repository(
5
+ local_dir="./",
6
+ repo_type="model",
7
+ clone_from="stistko/CzechPunctuationKapitalizationBART",
8
+ token=True
9
+ )
10
+ repo.git_pull()
11
+
12
+ from model import Model
13
+
14
+ model = Model()
15
+
16
+ st.write("""
17
+ # Czech Punctuation and Capitalization Model (CPCM)
18
+ This application uses a transformer model 'BART-small' with subsequent fine-tuning and a contextual window of 300 tokens.
19
+ """)
20
+
21
+ # Text input field
22
+ input_text = st.text_input("Enter text here:")
23
+
24
+ # Button for submission
25
+ submit_button = st.button("Submit")
26
+
27
+ # Action after button press
28
+ if submit_button:
29
+ st.write(f"Output: {model.run(input_text)}")