Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,24 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline, AutoModelForMaskedLM, AutoTokenizer
|
3 |
from cltk.data.fetch import FetchCorpus
|
|
|
4 |
import stanza
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
stanza.download("la")
|
6 |
corpus_downloader = FetchCorpus(language="lat")
|
7 |
corpus_downloader.import_corpus("lat_models_cltk")
|
8 |
|
|
|
|
|
9 |
# Esempio: prova a importare CLTK (se presente)
|
10 |
try:
|
11 |
from cltk import NLP
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline, AutoModelForMaskedLM, AutoTokenizer
|
3 |
from cltk.data.fetch import FetchCorpus
|
4 |
+
import builtins
|
5 |
import stanza
|
6 |
+
|
7 |
+
# Salva la vecchia funzione input
|
8 |
+
_original_input = builtins.input
|
9 |
+
# Definisci una funzione che restituisce sempre "Y"
|
10 |
+
def _always_yes(prompt=""):
|
11 |
+
print(prompt, "Y") # per far vedere a log che abbiamo risposto 'Y'
|
12 |
+
return "Y"
|
13 |
+
# Sostituisci input con _always_yes
|
14 |
+
builtins.input = _always_yes
|
15 |
+
|
16 |
stanza.download("la")
|
17 |
corpus_downloader = FetchCorpus(language="lat")
|
18 |
corpus_downloader.import_corpus("lat_models_cltk")
|
19 |
|
20 |
+
# Ripristina la funzione input originale (importante!)
|
21 |
+
builtins.input = _original_input
|
22 |
# Esempio: prova a importare CLTK (se presente)
|
23 |
try:
|
24 |
from cltk import NLP
|