Spaces:
Runtime error
Runtime error
load model bf16
Browse files
app.py
CHANGED
|
@@ -62,9 +62,8 @@ def predict(message, history, system_prompt, temperature, max_tokens):
|
|
| 62 |
if __name__ == "__main__":
|
| 63 |
args = parse_args()
|
| 64 |
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stable-code-instruct-3b")
|
| 65 |
-
model = AutoModelForCausalLM.from_pretrained("stabilityai/stable-code-instruct-3b")
|
| 66 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 67 |
-
model = model.half()
|
| 68 |
model = model.to(device)
|
| 69 |
gr.ChatInterface(
|
| 70 |
predict,
|
|
|
|
| 62 |
if __name__ == "__main__":
|
| 63 |
args = parse_args()
|
| 64 |
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stable-code-instruct-3b")
|
| 65 |
+
model = AutoModelForCausalLM.from_pretrained("stabilityai/stable-code-instruct-3b", torch_dtype=torch.bfloat16)
|
| 66 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
|
| 67 |
model = model.to(device)
|
| 68 |
gr.ChatInterface(
|
| 69 |
predict,
|