xzl12306 commited on
Commit
5fb9fdb
·
1 Parent(s): 8f2263e
tinychart/model/language_model/llava_phi.py CHANGED
@@ -29,6 +29,7 @@ from transformers.modeling_outputs import CausalLMOutputWithPast
29
 
30
  from tinychart.model.llava_arch import LlavaMetaModel, LlavaMetaForCausalLM
31
  from tinychart.model.model_factory import *
 
32
 
33
  class TinyChartPhiConfig(PhiConfig):
34
  model_type = "tiny_chart_phi"
@@ -103,6 +104,7 @@ class TinyChartPhiForCausalLM(PhiForCausalLM, LlavaMetaForCausalLM):
103
  )
104
 
105
  @torch.no_grad()
 
106
  def generate(
107
  self,
108
  inputs: Optional[torch.Tensor] = None,
 
29
 
30
  from tinychart.model.llava_arch import LlavaMetaModel, LlavaMetaForCausalLM
31
  from tinychart.model.model_factory import *
32
+ import spaces
33
 
34
  class TinyChartPhiConfig(PhiConfig):
35
  model_type = "tiny_chart_phi"
 
104
  )
105
 
106
  @torch.no_grad()
107
+ @spaces.GPU
108
  def generate(
109
  self,
110
  inputs: Optional[torch.Tensor] = None,