Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,17 +3,15 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
import spaces
|
6 |
-
|
7 |
|
|
|
8 |
model = AutoModelForCausalLM.from_pretrained(
|
9 |
-
|
10 |
-
device_map="
|
11 |
-
torch_dtype=
|
12 |
-
trust_remote_code=True,
|
13 |
)
|
14 |
|
15 |
-
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
16 |
-
|
17 |
print("Loading finished.")
|
18 |
|
19 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
|
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
import spaces
|
6 |
+
model_name = "Writer/camel-5b-hf"
|
7 |
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
9 |
model = AutoModelForCausalLM.from_pretrained(
|
10 |
+
model_name,
|
11 |
+
device_map="auto",
|
12 |
+
torch_dtype=torch.float16
|
|
|
13 |
)
|
14 |
|
|
|
|
|
15 |
print("Loading finished.")
|
16 |
|
17 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|