Instructions to use stanrom/ShareCaptioner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stanrom/ShareCaptioner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="stanrom/ShareCaptioner", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("stanrom/ShareCaptioner", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
tie.weights
Browse files
modeling_InternLM_XComposer.py
CHANGED
|
@@ -68,6 +68,7 @@ class InternLMXComposerForCausalLM(PreTrainedModel):
|
|
| 68 |
with torch.device('meta'):
|
| 69 |
self.internlm_model = InternLMForCausalLM._from_config(config)
|
| 70 |
self.internlm_model.to_empty(device='meta').to(torch.float16)
|
|
|
|
| 71 |
# self.internlm_model.to(config.device)
|
| 72 |
|
| 73 |
self.internlm_proj = nn.Linear(4096,
|
|
|
|
| 68 |
with torch.device('meta'):
|
| 69 |
self.internlm_model = InternLMForCausalLM._from_config(config)
|
| 70 |
self.internlm_model.to_empty(device='meta').to(torch.float16)
|
| 71 |
+
self.internlm_model.tie_weights()
|
| 72 |
# self.internlm_model.to(config.device)
|
| 73 |
|
| 74 |
self.internlm_proj = nn.Linear(4096,
|