ariG23498 HF Staff commited on
Commit
bd93dd1
·
verified ·
1 Parent(s): da471f5

Upload openbmb_MiniCPM-V-4_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. openbmb_MiniCPM-V-4_0.py +4 -0
openbmb_MiniCPM-V-4_0.py CHANGED
@@ -26,6 +26,10 @@ try:
26
  },
27
  ]
28
  pipe(text=messages)
 
 
 
 
29
  with open('openbmb_MiniCPM-V-4_0.txt', 'w') as f:
30
  f.write('Everything was good in openbmb_MiniCPM-V-4_0.txt')
31
  except Exception as e:
 
26
  },
27
  ]
28
  pipe(text=messages)
29
+
30
+ # Load model directly
31
+ from transformers import AutoModel
32
+ model = AutoModel.from_pretrained("openbmb/MiniCPM-V-4", trust_remote_code=True, torch_dtype="auto"),
33
  with open('openbmb_MiniCPM-V-4_0.txt', 'w') as f:
34
  f.write('Everything was good in openbmb_MiniCPM-V-4_0.txt')
35
  except Exception as e: