Spaces:
Runtime error
Runtime error
Init
Browse files- app.py +28 -0
- requirements.txt +7 -0
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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/CzechCapitalizationProtected",
|
| 8 |
+
token=True
|
| 9 |
+
)
|
| 10 |
+
repo.git_pull()
|
| 11 |
+
|
| 12 |
+
from scripts.scripts.model import CapitalizationModel
|
| 13 |
+
|
| 14 |
+
model = CapitalizationModel()
|
| 15 |
+
|
| 16 |
+
# Inicializace
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Textové vstupní pole
|
| 21 |
+
input_text = st.text_input("Zadejte text zde:")
|
| 22 |
+
|
| 23 |
+
# Tlačítko pro potvrzení
|
| 24 |
+
submit_button = st.button("Odeslat")
|
| 25 |
+
|
| 26 |
+
# Akce po stisknutí tlačítka
|
| 27 |
+
if submit_button:
|
| 28 |
+
st.write(f"Výstup: {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
|