JJS341 commited on
Commit
fce2f1f
·
verified ·
1 Parent(s): 7506d7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -13,10 +13,11 @@ import torch
13
  # 我們改用更底層的載入方式,確保穩定性
14
  model_name = "biu-nlp/lingmess-coref"
15
  try:
16
- from fastcoref import LingmessCoref
17
- model = LingmessCoref(device='cpu')
18
- except:
19
- # 備用方案:如果 fastcoref 還是掛掉,至少讓翻譯功能能展示
 
20
  model = None
21
 
22
  def coref_chat(user_input):
 
13
  # 我們改用更底層的載入方式,確保穩定性
14
  model_name = "biu-nlp/lingmess-coref"
15
  try:
16
+ from fastcoref import FCoref
17
+ # 強制指定使用較小的 bert 模型,而不是大型的 lingmess
18
+ model = FCoref(model_name='biu-nlp/f-coref', device='cpu')
19
+ except Exception as e:
20
+ print(f"模型載入失敗: {e}")
21
  model = None
22
 
23
  def coref_chat(user_input):