Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,11 +114,11 @@ class AspectSentimentPipeline(Pipeline):
|
|
| 114 |
|
| 115 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 116 |
|
| 117 |
-
aspect_extraction_model = BertForTokenClassification.from_pretrained("
|
| 118 |
-
aspect_extraction_tokenizer = BertTokenizerFast.from_pretrained("
|
| 119 |
|
| 120 |
-
aspect_sentiment_model = BertForSequenceClassification.from_pretrained("
|
| 121 |
-
aspect_sentiment_tokenizer = BertTokenizer.from_pretrained("
|
| 122 |
|
| 123 |
pipeline = AspectSentimentPipeline(
|
| 124 |
aspect_extraction_model=aspect_extraction_model,
|
|
@@ -144,4 +144,4 @@ async def predict(item: Item):
|
|
| 144 |
|
| 145 |
|
| 146 |
if __name__=="__main__":
|
| 147 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
|
|
| 114 |
|
| 115 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 116 |
|
| 117 |
+
aspect_extraction_model = BertForTokenClassification.from_pretrained("thealper2/aspect_extraction_model")
|
| 118 |
+
aspect_extraction_tokenizer = BertTokenizerFast.from_pretrained("thealper2/aspect_extraction_tokenizer")
|
| 119 |
|
| 120 |
+
aspect_sentiment_model = BertForSequenceClassification.from_pretrained("thealper2/aspect_sentiment_model")
|
| 121 |
+
aspect_sentiment_tokenizer = BertTokenizer.from_pretrained("thealper2/aspect_sentiment_tokenizer")
|
| 122 |
|
| 123 |
pipeline = AspectSentimentPipeline(
|
| 124 |
aspect_extraction_model=aspect_extraction_model,
|
|
|
|
| 144 |
|
| 145 |
|
| 146 |
if __name__=="__main__":
|
| 147 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|