AmiKim commited on
Commit
785706b
ยท
verified ยท
1 Parent(s): 9155716

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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 ํŒŒ์ผ์„ ์ฝ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."}