will702 commited on
Commit
ae8739a
·
verified ·
1 Parent(s): 0061649

Upload 4 files

Browse files
Files changed (2) hide show
  1. app.py +5 -5
  2. requirements.txt +2 -2
app.py CHANGED
@@ -5,17 +5,17 @@ from fastapi import FastAPI, HTTPException, Request
5
  from pydantic import BaseModel
6
  from transformers import pipeline
7
 
8
- MODEL_NAME = "ayameRushia/bert-base-indonesian-1.5G-sentiment-analysis-smsa"
9
  API_KEY = os.getenv("API_KEY")
10
 
11
- # Label mapping — IndoNLU SMSA: positive/neutral/negative
12
  LABEL_MAP = {
13
- "positive": "positive",
14
- "neutral": "neutral",
15
- "negative": "negative",
16
  "label_0": "positive",
17
  "label_1": "neutral",
18
  "label_2": "negative",
 
 
 
19
  }
20
 
21
  classifier = None
 
5
  from pydantic import BaseModel
6
  from transformers import pipeline
7
 
8
+ MODEL_NAME = "ihsan31415/indo-roBERTa-financial-sentiment"
9
  API_KEY = os.getenv("API_KEY")
10
 
11
+ # Label mapping — flipped: 0=Positive, 1=Neutral, 2=Negative
12
  LABEL_MAP = {
 
 
 
13
  "label_0": "positive",
14
  "label_1": "neutral",
15
  "label_2": "negative",
16
+ "positive": "positive",
17
+ "neutral": "neutral",
18
+ "negative": "negative",
19
  }
20
 
21
  classifier = None
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  fastapi==0.115.5
2
  uvicorn[standard]==0.32.1
3
- transformers
4
- torch
 
1
  fastapi==0.115.5
2
  uvicorn[standard]==0.32.1
3
+ transformers>=4.51.0
4
+ torch>=2.6.0