Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,10 +17,14 @@ nltk.download('all')
|
|
17 |
# Constants
|
18 |
HF_REPO = "katsukiai/DeepFocus-X3"
|
19 |
TOKENIZER = 'bert-base-uncased'
|
20 |
-
MODELS = ["bert-base-uncased", "gpt2", "roberta-base", "distilbert-base-uncased", "albert-v2"] #
|
21 |
|
22 |
# Initialize Models
|
23 |
-
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# Functions
|
26 |
def process_text(text):
|
@@ -81,7 +85,7 @@ body {
|
|
81 |
text-align: center;
|
82 |
margin-bottom: 20px;
|
83 |
}
|
84 |
-
#input_text, #output_text, #log_output {
|
85 |
width: 100%;
|
86 |
max-width: 600px;
|
87 |
margin: 10px 0;
|
|
|
17 |
# Constants
|
18 |
HF_REPO = "katsukiai/DeepFocus-X3"
|
19 |
TOKENIZER = 'bert-base-uncased'
|
20 |
+
MODELS = ["bert-base-uncased", "gpt2", "roberta-base", "distilbert-base-uncased", "albert-base-v2"] # Corrected model identifier
|
21 |
|
22 |
# Initialize Models
|
23 |
+
try:
|
24 |
+
models = {model: pipeline('feature-extraction', model=model) for model in MODELS}
|
25 |
+
except Exception as e:
|
26 |
+
logging.error(f"Error initializing models: {e}")
|
27 |
+
models = {}
|
28 |
|
29 |
# Functions
|
30 |
def process_text(text):
|
|
|
85 |
text-align: center;
|
86 |
margin-bottom: 20px;
|
87 |
}
|
88 |
+
#input_text, #output_text, #log_output, #commit_input, #username_input, #metadata_input, #uptime_text {
|
89 |
width: 100%;
|
90 |
max-width: 600px;
|
91 |
margin: 10px 0;
|