Spaces:
Running on Zero
Running on Zero
Match model Transformers 5.19.0 and support TokenizersBackend
Browse files- README.md +3 -6
- app.py +1 -1
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -60,9 +60,6 @@ float32 and will be slow. Outside ZeroGPU, the `spaces.GPU` decorator has no eff
|
|
| 60 |
|
| 61 |
## Model compatibility
|
| 62 |
|
| 63 |
-
Dependencies pin Transformers
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
version or additional packages, update `requirements.txt` to match the model's
|
| 67 |
-
instructions. The repository must expose an `AutoModelForCausalLM` implementation
|
| 68 |
-
with `generate()` and a tokenizer chat template.
|
|
|
|
| 60 |
|
| 61 |
## Model compatibility
|
| 62 |
|
| 63 |
+
Dependencies pin Transformers 5.19.0 to match the model configuration and support
|
| 64 |
+
its `TokenizersBackend` tokenizer, and Gradio 5.49.1. The model's custom
|
| 65 |
+
`AutoModelForCausalLM` implementation loads with `trust_remote_code=True`.
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -141,7 +141,7 @@ def load_model():
|
|
| 141 |
model = AutoModelForCausalLM.from_pretrained(
|
| 142 |
MODEL_ID,
|
| 143 |
**common,
|
| 144 |
-
|
| 145 |
).to(device).eval()
|
| 146 |
return ChatModel(tokenizer, model)
|
| 147 |
|
|
|
|
| 141 |
model = AutoModelForCausalLM.from_pretrained(
|
| 142 |
MODEL_ID,
|
| 143 |
**common,
|
| 144 |
+
dtype=torch.bfloat16 if device == "cuda" else torch.float32,
|
| 145 |
).to(device).eval()
|
| 146 |
return ChatModel(tokenizer, model)
|
| 147 |
|
requirements.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
spaces==0.51.3
|
| 2 |
gradio==5.49.1
|
| 3 |
-
transformers==
|
| 4 |
torch==2.8.0
|
| 5 |
sentencepiece>=0.2.0,<0.3
|
| 6 |
protobuf>=4.25,<7
|
|
|
|
| 1 |
spaces==0.51.3
|
| 2 |
gradio==5.49.1
|
| 3 |
+
transformers==5.19.0
|
| 4 |
torch==2.8.0
|
| 5 |
sentencepiece>=0.2.0,<0.3
|
| 6 |
protobuf>=4.25,<7
|