Commit
·
bacc7cf
1
Parent(s):
ae8be56
Update app.py
Browse files
app.py
CHANGED
@@ -28,8 +28,10 @@ model_id = "philschmid/instruct-igel-001"
|
|
28 |
if device == "cpu":
|
29 |
model = AutoModelForCausalLM.from_pretrained(model_id, low_cpu_mem_usage=True)
|
30 |
else:
|
31 |
-
torch_dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] == 8 else torch.float16
|
32 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch_dtype, device_map="auto")
|
|
|
|
|
33 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
34 |
|
35 |
prompt_template = f"### Anweisung:\n{{input}}\n\n### Antwort:"
|
|
|
28 |
if device == "cpu":
|
29 |
model = AutoModelForCausalLM.from_pretrained(model_id, low_cpu_mem_usage=True)
|
30 |
else:
|
31 |
+
# torch_dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] == 8 else torch.float16
|
32 |
+
# model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch_dtype, device_map="auto")
|
33 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", load_in_8bit=True)
|
34 |
+
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
36 |
|
37 |
prompt_template = f"### Anweisung:\n{{input}}\n\n### Antwort:"
|