Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ from PIL import Image, ImageDraw, UnidentifiedImageError
|
|
16 |
base_url = "https://huggingface.co/spaces/Tonic1/Official-Qwen-VL-Chat"
|
17 |
model_name = "Qwen/Qwen-VL-Chat"
|
18 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
19 |
-
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto",
|
20 |
model.generation_config = GenerationConfig.from_pretrained(model_name, trust_remote_code=True)
|
21 |
|
22 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
16 |
base_url = "https://huggingface.co/spaces/Tonic1/Official-Qwen-VL-Chat"
|
17 |
model_name = "Qwen/Qwen-VL-Chat"
|
18 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
19 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", fp16=True, trust_remote_code=True).eval()
|
20 |
model.generation_config = GenerationConfig.from_pretrained(model_name, trust_remote_code=True)
|
21 |
|
22 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|