yummyu commited on
Commit
5746d3f
·
verified ·
1 Parent(s): 091616b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -43,21 +43,19 @@ async def load_models():
43
  try:
44
  from transformers import pipeline
45
 
46
- # 非常に軽量な感情分析モデル
47
  print("📥 軽量感情分析モデルをロード中...")
48
  sentiment_classifier = pipeline(
49
  "sentiment-analysis",
50
- model="prajjwal1/bert-tiny", # 非常に軽量
51
- cache_dir="/app/.cache"
52
  )
53
  print("✅ 感情分析モデル読み込み完了")
54
 
55
- # 軽量テキスト生成モデル
56
  print("📥 軽量テキスト生成モデルをロード中...")
57
  text_generator = pipeline(
58
  "text-generation",
59
- model="sshleifer/tiny-gpt2", # 非常に軽量
60
- cache_dir="/app/.cache"
61
  )
62
  print("✅ テキスト生成モデル読み込み完了")
63
 
 
43
  try:
44
  from transformers import pipeline
45
 
46
+ # 非常に軽量な感情分析モデル(cache_dirを削除)
47
  print("📥 軽量感情分析モデルをロード中...")
48
  sentiment_classifier = pipeline(
49
  "sentiment-analysis",
50
+ model="prajjwal1/bert-tiny"
 
51
  )
52
  print("✅ 感情分析モデル読み込み完了")
53
 
54
+ # 軽量テキスト生成モデル(cache_dirを削除)
55
  print("📥 軽量テキスト生成モデルをロード中...")
56
  text_generator = pipeline(
57
  "text-generation",
58
+ model="sshleifer/tiny-gpt2"
 
59
  )
60
  print("✅ テキスト生成モデル読み込み完了")
61