Spaces:
Sleeping
Sleeping
nihuajian
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,14 +21,14 @@ def load_model():
|
|
| 21 |
'openbmb/MiniCPM-o-2_6',
|
| 22 |
trust_remote_code=True,
|
| 23 |
attn_implementation='sdpa',
|
| 24 |
-
torch_dtype=torch.
|
| 25 |
init_vision=True,
|
| 26 |
init_audio=False,
|
| 27 |
init_tts=False
|
| 28 |
)
|
| 29 |
-
model = model.eval()
|
| 30 |
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-o-2_6', trust_remote_code=True)
|
| 31 |
-
print("模型加载完成
|
| 32 |
return model, tokenizer
|
| 33 |
|
| 34 |
def clean_markdown_output(text):
|
|
@@ -292,7 +292,7 @@ def create_interface():
|
|
| 292 |
### 🔧 技术支持
|
| 293 |
- 模型: MiniCPM-o-2.6
|
| 294 |
- 框架: Gradio + Transformers
|
| 295 |
-
-
|
| 296 |
""")
|
| 297 |
|
| 298 |
return interface
|
|
|
|
| 21 |
'openbmb/MiniCPM-o-2_6',
|
| 22 |
trust_remote_code=True,
|
| 23 |
attn_implementation='sdpa',
|
| 24 |
+
torch_dtype=torch.bfloat16,
|
| 25 |
init_vision=True,
|
| 26 |
init_audio=False,
|
| 27 |
init_tts=False
|
| 28 |
)
|
| 29 |
+
model = model.eval().cuda()
|
| 30 |
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-o-2_6', trust_remote_code=True)
|
| 31 |
+
print("模型加载完成")
|
| 32 |
return model, tokenizer
|
| 33 |
|
| 34 |
def clean_markdown_output(text):
|
|
|
|
| 292 |
### 🔧 技术支持
|
| 293 |
- 模型: MiniCPM-o-2.6
|
| 294 |
- 框架: Gradio + Transformers
|
| 295 |
+
- GPU: CUDA加速推理
|
| 296 |
""")
|
| 297 |
|
| 298 |
return interface
|