Instructions to use stanrom/internlm-xcomposer-7b-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stanrom/internlm-xcomposer-7b-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="stanrom/internlm-xcomposer-7b-4bit", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("stanrom/internlm-xcomposer-7b-4bit", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_InternLM_XComposer.py
Browse files
modeling_InternLM_XComposer.py
CHANGED
|
@@ -36,12 +36,12 @@ class InternLMXComposerForCausalLM(PreTrainedModel):
|
|
| 36 |
|
| 37 |
gen_config = dict(
|
| 38 |
num_beams=5,
|
| 39 |
-
do_sample=
|
| 40 |
min_length=1,
|
| 41 |
repetition_penalty=1.5,
|
| 42 |
length_penalty=1.0,
|
| 43 |
temperature=0.2,
|
| 44 |
-
max_new_tokens=
|
| 45 |
)
|
| 46 |
|
| 47 |
def __init__(self, config):
|
|
|
|
| 36 |
|
| 37 |
gen_config = dict(
|
| 38 |
num_beams=5,
|
| 39 |
+
do_sample=True,
|
| 40 |
min_length=1,
|
| 41 |
repetition_penalty=1.5,
|
| 42 |
length_penalty=1.0,
|
| 43 |
temperature=0.2,
|
| 44 |
+
max_new_tokens=1000,
|
| 45 |
)
|
| 46 |
|
| 47 |
def __init__(self, config):
|