Spaces:
Runtime error
Runtime error
No device, and cuda in the spaces function?
Browse files
app.py
CHANGED
|
@@ -16,7 +16,6 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
| 16 |
quantize_config = BaseQuantizeConfig(
|
| 17 |
bits=4,
|
| 18 |
group_size=128,
|
| 19 |
-
device_map="auto",
|
| 20 |
desc_act=False
|
| 21 |
)
|
| 22 |
model = AutoGPTQForCausalLM.from_quantized(
|
|
@@ -46,7 +45,7 @@ def respond(
|
|
| 46 |
|
| 47 |
response = ""
|
| 48 |
|
| 49 |
-
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
| 50 |
streamer = TextIteratorStreamer(tokenizer, skip_special_tokens=True, skip_prompt=True)
|
| 51 |
|
| 52 |
thread = Thread(
|
|
|
|
| 16 |
quantize_config = BaseQuantizeConfig(
|
| 17 |
bits=4,
|
| 18 |
group_size=128,
|
|
|
|
| 19 |
desc_act=False
|
| 20 |
)
|
| 21 |
model = AutoGPTQForCausalLM.from_quantized(
|
|
|
|
| 45 |
|
| 46 |
response = ""
|
| 47 |
|
| 48 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device=torch.device("cuda"))
|
| 49 |
streamer = TextIteratorStreamer(tokenizer, skip_special_tokens=True, skip_prompt=True)
|
| 50 |
|
| 51 |
thread = Thread(
|