Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -939,7 +939,7 @@ if __name__ == "__main__":
|
|
| 939 |
attn_implementation='flash_attention_2', # OR 'sdpa' for Ascend NPUs
|
| 940 |
# torch_dtype=args.torch_dtype,
|
| 941 |
# attn_implementation='sdpa', # OR 'sdpa' for Ascend NPUs
|
| 942 |
-
|
| 943 |
low_cpu_mem_usage=True,
|
| 944 |
trust_remote_code=True).eval().cuda()
|
| 945 |
processor = AutoProcessor.from_pretrained(args.model_name, trust_remote_code=True)
|
|
@@ -948,13 +948,13 @@ if __name__ == "__main__":
|
|
| 948 |
dualvitok = AutoModel.from_pretrained(args.tokenizer_path,
|
| 949 |
torch_dtype=torch.float32,
|
| 950 |
trust_remote_code=True,
|
| 951 |
-
|
| 952 |
).eval().cuda()
|
| 953 |
processor.set_vision_tokenizer(dualvitok)
|
| 954 |
|
| 955 |
# (Optional): set the sdxl diffusion decoder. It will enable upsample 2x image resolution.
|
| 956 |
processor.load_diffusion_vision_detokenizer(args.diffusion_decoder_path,
|
| 957 |
-
|
| 958 |
|
| 959 |
# Assign device to model for later use
|
| 960 |
streamer = TextIteratorStreamer(processor.tokenizer, skip_prompt=True, skip_special_tokens=True, timeout=15)
|
|
|
|
| 939 |
attn_implementation='flash_attention_2', # OR 'sdpa' for Ascend NPUs
|
| 940 |
# torch_dtype=args.torch_dtype,
|
| 941 |
# attn_implementation='sdpa', # OR 'sdpa' for Ascend NPUs
|
| 942 |
+
use_auth_token=True,
|
| 943 |
low_cpu_mem_usage=True,
|
| 944 |
trust_remote_code=True).eval().cuda()
|
| 945 |
processor = AutoProcessor.from_pretrained(args.model_name, trust_remote_code=True)
|
|
|
|
| 948 |
dualvitok = AutoModel.from_pretrained(args.tokenizer_path,
|
| 949 |
torch_dtype=torch.float32,
|
| 950 |
trust_remote_code=True,
|
| 951 |
+
use_auth_token=True,
|
| 952 |
).eval().cuda()
|
| 953 |
processor.set_vision_tokenizer(dualvitok)
|
| 954 |
|
| 955 |
# (Optional): set the sdxl diffusion decoder. It will enable upsample 2x image resolution.
|
| 956 |
processor.load_diffusion_vision_detokenizer(args.diffusion_decoder_path,
|
| 957 |
+
use_auth_token=True)
|
| 958 |
|
| 959 |
# Assign device to model for later use
|
| 960 |
streamer = TextIteratorStreamer(processor.tokenizer, skip_prompt=True, skip_special_tokens=True, timeout=15)
|