Spaces:
Runtime error
Runtime error
Update ai_assistant.py
Browse files- ai_assistant.py +2 -2
ai_assistant.py
CHANGED
|
@@ -44,8 +44,8 @@ def build_qa():
|
|
| 44 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 45 |
model = AutoModelForCausalLM.from_pretrained(
|
| 46 |
model_name,
|
| 47 |
-
device_map="auto",
|
| 48 |
-
|
| 49 |
)
|
| 50 |
llm = TextGenerationPipeline(
|
| 51 |
model=model,
|
|
|
|
| 44 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 45 |
model = AutoModelForCausalLM.from_pretrained(
|
| 46 |
model_name,
|
| 47 |
+
device_map="auto", # works after installing accelerate
|
| 48 |
+
dtype=torch.float16, # instead of torch_dtype
|
| 49 |
)
|
| 50 |
llm = TextGenerationPipeline(
|
| 51 |
model=model,
|