Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,15 @@ import spaces
|
|
3 |
import torch
|
4 |
import torch.amp as amp
|
5 |
|
6 |
-
from transformers import
|
7 |
|
8 |
repo_id = "appmana/Cosmos-1.0-Prompt-Upsampler-12B-Text2World-hf"
|
9 |
|
10 |
-
model =
|
|
|
|
|
|
|
|
|
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",
|