benjamin-paine commited on
Commit
9d4f74f
·
verified ·
1 Parent(s): 754da99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -3,11 +3,15 @@ import spaces
3
  import torch
4
  import torch.amp as amp
5
 
6
- from transformers import AutoModel, AutoTokenizer, pipeline
7
 
8
  repo_id = "appmana/Cosmos-1.0-Prompt-Upsampler-12B-Text2World-hf"
9
 
10
- model = AutoModel.from_pretrained(repo_id, torch_dtype=torch.bfloat16)
 
 
 
 
11
  tokenizer = AutoTokenizer.from_pretrained(repo_id)
12
  pipe = pipeline(
13
  "text-generation",
 
3
  import torch
4
  import torch.amp as amp
5
 
6
+ from transformers import MistralForCausalLM, AutoTokenizer, pipeline
7
 
8
  repo_id = "appmana/Cosmos-1.0-Prompt-Upsampler-12B-Text2World-hf"
9
 
10
+ model = MistralForCausalLM.from_pretrained(
11
+ repo_id,
12
+ attn_implementation="flash_attention_2",
13
+ torch_dtype=torch.bfloat16
14
+ )
15
  tokenizer = AutoTokenizer.from_pretrained(repo_id)
16
  pipe = pipeline(
17
  "text-generation",