Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,7 @@ tokenizer = AutoTokenizer.from_pretrained(
|
|
17 |
|
18 |
model = LlavaQwen2ForCausalLM.from_pretrained(
|
19 |
'qnguyen3/nanoLLaVA-1.5',
|
20 |
-
torch_dtype=torch.
|
21 |
-
attn_implementation="flash_attention_2",
|
22 |
trust_remote_code=True,
|
23 |
device_map='auto')
|
24 |
|
@@ -84,7 +83,6 @@ def bot_streaming(message, history):
|
|
84 |
messages.append({"role": "user", "content": f"<image>\n{message['text']}"})
|
85 |
elif len(history) == 0 and image is None:
|
86 |
messages.append({"role": "user", "content": message['text'] })
|
87 |
-
model = model.to('cuda')
|
88 |
|
89 |
# if image is None:
|
90 |
# gr.Error("You need to upload an image for LLaVA to work.")
|
|
|
17 |
|
18 |
model = LlavaQwen2ForCausalLM.from_pretrained(
|
19 |
'qnguyen3/nanoLLaVA-1.5',
|
20 |
+
torch_dtype=torch.bfloat16,
|
|
|
21 |
trust_remote_code=True,
|
22 |
device_map='auto')
|
23 |
|
|
|
83 |
messages.append({"role": "user", "content": f"<image>\n{message['text']}"})
|
84 |
elif len(history) == 0 and image is None:
|
85 |
messages.append({"role": "user", "content": message['text'] })
|
|
|
86 |
|
87 |
# if image is None:
|
88 |
# gr.Error("You need to upload an image for LLaVA to work.")
|