Spaces:
Runtime error
Runtime error
jhsheng
commited on
Commit
•
fa64fd4
1
Parent(s):
2444f6c
init
Browse files- app.py +3 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -43,8 +43,9 @@ os.environ['CUDA_VISIBLE_DEVICES'] = '0' # 默认使用0号显卡,避免Window
|
|
43 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
44 |
|
45 |
# 指定模型名称或路径
|
46 |
-
model_name_or_path =
|
47 |
-
|
|
|
48 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
|
49 |
|
50 |
|
|
|
43 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
44 |
|
45 |
# 指定模型名称或路径
|
46 |
+
model_name_or_path = 'scutcyr/BianQue-2'
|
47 |
+
model = AutoModel.from_pretrained(model_name_or_path, trust_remote_code=True).half()
|
48 |
+
model.to(device)
|
49 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
|
50 |
|
51 |
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
protobuf
|
2 |
-
transformers==4.
|
3 |
cpm_kernels
|
4 |
torch>=1.10
|
5 |
gradio
|
|
|
1 |
protobuf
|
2 |
+
transformers==4.28.0
|
3 |
cpm_kernels
|
4 |
torch>=1.10
|
5 |
gradio
|