Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ import time
|
|
8 |
model_id = "facebook/opt-6.7b"
|
9 |
assistant_id = "facebook/opt-125m"
|
10 |
|
11 |
-
model = AutoModelForCausalLM.from_pretrained(model_id,
|
12 |
-
assistant_model = AutoModelForCausalLM.from_pretrained(assistant_id).to(device=model.device, dtype=torch.
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
14 |
|
15 |
def run_generation(user_text, use_assistant, temperature, max_new_tokens):
|
|
|
8 |
model_id = "facebook/opt-6.7b"
|
9 |
assistant_id = "facebook/opt-125m"
|
10 |
|
11 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_8bit=True, device_map="auto")
|
12 |
+
assistant_model = AutoModelForCausalLM.from_pretrained(assistant_id).to(device=model.device, dtype=torch.bfloat16)
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
14 |
|
15 |
def run_generation(user_text, use_assistant, temperature, max_new_tokens):
|