Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -22,10 +22,6 @@ from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
22 |
from os.path import dirname
|
23 |
|
24 |
import gradio as gr
|
25 |
-
from zenml.logger import get_logger
|
26 |
-
|
27 |
-
# Initialize logger
|
28 |
-
logger = get_logger(__name__)
|
29 |
|
30 |
@click.command()
|
31 |
@click.option("--tokenizer_name_or_path", default="tokenizer", help="Name or the path of the tokenizer.")
|
@@ -71,9 +67,9 @@ def sentiment_analysis(
|
|
71 |
|
72 |
def analyze_text(text):
|
73 |
model_path = f"{dirname(__file__)}/{tokenizer_name_or_path}/"
|
74 |
-
|
75 |
tokenizer_path = f"{dirname(__file__)}/{model_name_or_path}/"
|
76 |
-
|
77 |
tokenizer = AutoTokenizer.from_pretrained(tokenizer_path)
|
78 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
79 |
|
|
|
22 |
from os.path import dirname
|
23 |
|
24 |
import gradio as gr
|
|
|
|
|
|
|
|
|
25 |
|
26 |
@click.command()
|
27 |
@click.option("--tokenizer_name_or_path", default="tokenizer", help="Name or the path of the tokenizer.")
|
|
|
67 |
|
68 |
def analyze_text(text):
|
69 |
model_path = f"{dirname(__file__)}/{tokenizer_name_or_path}/"
|
70 |
+
print(f"Loading model from {model_path}")
|
71 |
tokenizer_path = f"{dirname(__file__)}/{model_name_or_path}/"
|
72 |
+
print(f"Loading tokenizer from {tokenizer_path}")
|
73 |
tokenizer = AutoTokenizer.from_pretrained(tokenizer_path)
|
74 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
75 |
|