Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import spaces
|
|
| 5 |
# Load model and tokenizer
|
| 6 |
model_name = "yuchenlin/Rex-v0.1-0.5B"
|
| 7 |
|
| 8 |
-
device = "
|
| 9 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, rex_size=3)
|
| 10 |
model = AutoModelForCausalLM.from_pretrained(
|
| 11 |
model_name,
|
|
@@ -13,7 +13,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 13 |
)
|
| 14 |
model.to(device)
|
| 15 |
|
| 16 |
-
|
| 17 |
def respond(
|
| 18 |
message,
|
| 19 |
history: list[tuple[str, str]],
|
|
|
|
| 5 |
# Load model and tokenizer
|
| 6 |
model_name = "yuchenlin/Rex-v0.1-0.5B"
|
| 7 |
|
| 8 |
+
device = "cuda" # the device to load the model onto
|
| 9 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, rex_size=3)
|
| 10 |
model = AutoModelForCausalLM.from_pretrained(
|
| 11 |
model_name,
|
|
|
|
| 13 |
)
|
| 14 |
model.to(device)
|
| 15 |
|
| 16 |
+
@spaces.GPU(enable_queue=True)
|
| 17 |
def respond(
|
| 18 |
message,
|
| 19 |
history: list[tuple[str, str]],
|