Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ except Exception as e:
|
|
| 22 |
# deepset/roberta-base-squad2 是一个问答模型,需要 context
|
| 23 |
try:
|
| 24 |
model2_name = "deepset/roberta-base-squad2"
|
| 25 |
-
qa_model = pipeline("question-answering", model=model2_name, device=0 if torch.cuda.
|
| 26 |
print(f"✅ 模型 2 (问答: {model2_name}) 加载成功!")
|
| 27 |
except Exception as e:
|
| 28 |
print(f"❌ 模型 2 (问答: {model2_name}) 加载失败: {e}")
|
|
@@ -135,7 +135,7 @@ def create_arena_tab():
|
|
| 135 |
# Report 选项卡内容创建函数 (30分)
|
| 136 |
def create_report_tab():
|
| 137 |
report_content_markdown = """
|
| 138 |
-
#
|
| 139 |
---
|
| 140 |
## 1. 模型及类别选择
|
| 141 |
### 1.1 所选模型的类型与背景说明
|
|
|
|
| 22 |
# deepset/roberta-base-squad2 是一个问答模型,需要 context
|
| 23 |
try:
|
| 24 |
model2_name = "deepset/roberta-base-squad2"
|
| 25 |
+
qa_model = pipeline("question-answering", model=model2_name, device=0 if torch.cuda.is_available() else -1)
|
| 26 |
print(f"✅ 模型 2 (问答: {model2_name}) 加载成功!")
|
| 27 |
except Exception as e:
|
| 28 |
print(f"❌ 模型 2 (问答: {model2_name}) 加载失败: {e}")
|
|
|
|
| 135 |
# Report 选项卡内容创建函数 (30分)
|
| 136 |
def create_report_tab():
|
| 137 |
report_content_markdown = """
|
| 138 |
+
# 🚀 Hugging Face 模型对比实验报告
|
| 139 |
---
|
| 140 |
## 1. 模型及类别选择
|
| 141 |
### 1.1 所选模型的类型与背景说明
|