unsubscribe irexyc commited on
Commit
218d304
1 Parent(s): a70f170

Update modeling_internlm.py (#11)

Browse files

- Update modeling_internlm.py (562c7324f272e236ca7817eee1281703ac607474)
- update assert (cd68ed8c4ed032bc9fd6a8a9b672145b5e5d13f6)


Co-authored-by: - <[email protected]>

Files changed (1) hide show
  1. modeling_internlm.py +4 -1
modeling_internlm.py CHANGED
@@ -615,6 +615,9 @@ class InternLMForCausalLM(InternLMPreTrainedModel):
615
  _auto_class = "AutoModelForCausalLM"
616
 
617
  def __init__(self, config):
 
 
 
618
  super().__init__(config)
619
  self.model = InternLMModel(config)
620
 
@@ -995,4 +998,4 @@ class InternLMForSequenceClassification(InternLMPreTrainedModel):
995
  past_key_values=transformer_outputs.past_key_values,
996
  hidden_states=transformer_outputs.hidden_states,
997
  attentions=transformer_outputs.attentions,
998
- )
 
615
  _auto_class = "AutoModelForCausalLM"
616
 
617
  def __init__(self, config):
618
+ assert (0), 'Inference by transformers is currently not supported, ' \
619
+ 'please follow README to convert the model ' \
620
+ 'and use lmdeploy (https://github.com/InternLM/lmdeploy) for inference.'
621
  super().__init__(config)
622
  self.model = InternLMModel(config)
623
 
 
998
  past_key_values=transformer_outputs.past_key_values,
999
  hidden_states=transformer_outputs.hidden_states,
1000
  attentions=transformer_outputs.attentions,
1001
+ )