Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,11 @@ import torch
|
|
| 13 |
# 我們改用更底層的載入方式,確保穩定性
|
| 14 |
model_name = "biu-nlp/lingmess-coref"
|
| 15 |
try:
|
| 16 |
-
from fastcoref import
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
| 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):
|