Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
import time
|
4 |
-
from transformers import AutoModelForQuestionAnswering, pipeline
|
5 |
|
6 |
-
# 设置使用GPU
|
7 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
-
|
9 |
-
# 初始化模型
|
10 |
-
model_name = "bert-base-uncased"
|
11 |
-
model = AutoModelForQuestionAnswering.from_pretrained(model_name).to(device)
|
12 |
-
|
13 |
-
# 创建管道
|
14 |
-
qa_pipeline = pipeline("question-answering", model=model, tokenizer=model_name)
|
15 |
|
16 |
# 假设这是队标的URL或本地路径
|
17 |
team_logo_url = './team-logo.jpg' # 替换为你的队标图片路径
|
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
import time
|
|
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# 假设这是队标的URL或本地路径
|
7 |
team_logo_url = './team-logo.jpg' # 替换为你的队标图片路径
|