mpolacek commited on
Commit
e6223dc
·
1 Parent(s): 10d8b30

Init files

Browse files
Files changed (3) hide show
  1. README.md +6 -6
  2. app.py +29 -0
  3. requirements.txt +7 -0
README.md CHANGED
@@ -1,13 +1,13 @@
1
  ---
2
- title: CzechPunctuation
3
- emoji: 🌖
4
- colorFrom: blue
5
- colorTo: pink
6
  sdk: streamlit
7
- sdk_version: 1.17.0
8
  app_file: app.py
9
  pinned: false
10
- license: gpl-3.0
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: CzechCapitalization
3
+ emoji: 😻
4
+ colorFrom: green
5
+ colorTo: purple
6
  sdk: streamlit
7
+ sdk_version: 1.21.0
8
  app_file: app.py
9
  pinned: false
10
+ license: cc-by-nc-4.0
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
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="scripts",
6
+ repo_type="model",
7
+ clone_from="stistko/CzechPunctuationProtected",
8
+ token=True
9
+ )
10
+ repo.git_pull()
11
+
12
+ from scripts.scripts.model import PunctuationModel
13
+
14
+ model = PunctuationModel()
15
+
16
+ st.write("""
17
+ # Czech Punctuation Model (CPM)
18
+ This application uses a transformer model 'Electra-small' with subsequent fine-tuning and a contextual window of 256 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)}")
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ torch
2
+ tqdm
3
+ numpy
4
+ sentencepiece
5
+ transformers
6
+ scikit-learn
7
+ huggingface_hub