Locutusque commited on
Commit
417c481
·
verified ·
1 Parent(s): 39b910c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -7,7 +7,10 @@ import os
7
 
8
  @spaces.GPU()
9
  def load_model(model_name):
10
- return pipeline("text-generation", model=model_name, device_map="cuda", torch_dtype=torch.bfloat16, trust_remote_code=True, token=os.environ["token"], use_fast=True)
 
 
 
11
  @spaces.GPU(duration=45)
12
  def generate(
13
  message,
 
7
 
8
  @spaces.GPU()
9
  def load_model(model_name):
10
+ if model_name == "Locutusque/Esmeralda-31B":
11
+ return pipeline("image-text-to-text", model=model_name, device_map="cuda", torch_dtype=torch.bfloat16, trust_remote_code=True, token=os.environ["token"], use_fast=True)
12
+ else:
13
+ return pipeline("text-generation", model=model_name, device_map="cuda", torch_dtype=torch.bfloat16, trust_remote_code=True, token=os.environ["token"], use_fast=True)
14
  @spaces.GPU(duration=45)
15
  def generate(
16
  message,