Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,10 @@ os.makedirs(UPLOAD_DIR, exist_ok=True)
|
|
| 9 |
|
| 10 |
app = FastAPI()
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
@app.get("/")
|
| 13 |
def greet_json():
|
| 14 |
return {"v": 0.1}
|
|
@@ -22,7 +26,7 @@ async def upload_file(file: UploadFile = File(...)):
|
|
| 22 |
f.write(contents)
|
| 23 |
|
| 24 |
# analyze_kakao_upload_file์ด ๋น๋๊ธฐ ํจ์๋ผ๋ฉด await ํ์
|
| 25 |
-
results_df = await analyze_kakao_csv(file)
|
| 26 |
|
| 27 |
if results_df is None:
|
| 28 |
return {"error": "CSV ํ์ผ์ ์ฝ์ ์ ์์ต๋๋ค."}
|
|
|
|
| 9 |
|
| 10 |
app = FastAPI()
|
| 11 |
|
| 12 |
+
model_name = "nlp04/korean_sentiment_analysis_kcelectra"
|
| 13 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 14 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 15 |
+
|
| 16 |
@app.get("/")
|
| 17 |
def greet_json():
|
| 18 |
return {"v": 0.1}
|
|
|
|
| 26 |
f.write(contents)
|
| 27 |
|
| 28 |
# analyze_kakao_upload_file์ด ๋น๋๊ธฐ ํจ์๋ผ๋ฉด await ํ์
|
| 29 |
+
results_df = await analyze_kakao_csv(file, model, tokenizer)
|
| 30 |
|
| 31 |
if results_df is None:
|
| 32 |
return {"error": "CSV ํ์ผ์ ์ฝ์ ์ ์์ต๋๋ค."}
|