Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,13 +41,15 @@ img {
|
|
| 41 |
import os
|
| 42 |
# Directory where the model and tokenizer will be saved
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
|
| 52 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
| 53 |
model.eval()
|
|
|
|
| 41 |
import os
|
| 42 |
# Directory where the model and tokenizer will be saved
|
| 43 |
|
| 44 |
+
# Load model directly
|
| 45 |
+
from transformers import AutoModel
|
| 46 |
+
model = AutoModel.from_pretrained("Nechba/Coin-Generative-Recognition", trust_remote_code=True).to(0)
|
| 47 |
+
# model = AutoModelForCausalLM.from_pretrained(
|
| 48 |
+
# MODEL_ID,
|
| 49 |
+
# torch_dtype=torch.bfloat16,
|
| 50 |
+
# low_cpu_mem_usage=True,
|
| 51 |
+
# trust_remote_code=True
|
| 52 |
+
# ).to(0)
|
| 53 |
|
| 54 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
| 55 |
model.eval()
|