Spaces:
Sleeping
Sleeping
jvroo
commited on
Commit
·
76707ec
1
Parent(s):
f1b6df5
Fix app remote
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ remote_model = "siebert/sentiment-roberta-large-english" # You can use the same
|
|
| 12 |
local_pipeline = pipeline("sentiment-analysis", model=local_model)
|
| 13 |
|
| 14 |
# Initialize the inference pipeline for remote model (same model for simplicity here)
|
| 15 |
-
|
| 16 |
|
| 17 |
# Function to perform sentiment analysis using the local pipeline
|
| 18 |
def local_sentiment_analysis(review):
|
|
@@ -45,7 +45,7 @@ def analyze_sentiment(review, mode):
|
|
| 45 |
model_info = f"Using local model: {local_model}"
|
| 46 |
elif mode == "Inference API":
|
| 47 |
sentiment, score = remote_sentiment_analysis(review)
|
| 48 |
-
model_info = f"Using remote model: {
|
| 49 |
else:
|
| 50 |
return "Invalid mode selected.", None
|
| 51 |
|
|
|
|
| 12 |
local_pipeline = pipeline("sentiment-analysis", model=local_model)
|
| 13 |
|
| 14 |
# Initialize the inference pipeline for remote model (same model for simplicity here)
|
| 15 |
+
remote_inference_client = InferenceClient(remote_model)
|
| 16 |
|
| 17 |
# Function to perform sentiment analysis using the local pipeline
|
| 18 |
def local_sentiment_analysis(review):
|
|
|
|
| 45 |
model_info = f"Using local model: {local_model}"
|
| 46 |
elif mode == "Inference API":
|
| 47 |
sentiment, score = remote_sentiment_analysis(review)
|
| 48 |
+
model_info = f"Using remote model: {remote_inference_client}"
|
| 49 |
else:
|
| 50 |
return "Invalid mode selected.", None
|
| 51 |
|