Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import time
|
|
9 |
model_id = "HuggingFaceTB/SmolLM-1.7B"
|
10 |
assistant_id = "HuggingFaceTB/SmolLM-135M"
|
11 |
|
12 |
-
model = AutoModelForCausalLM.from_pretrained(model_id)
|
13 |
-
assistant_model = AutoModelForCausalLM.from_pretrained(assistant_id)
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
15 |
|
16 |
@spaces.GPU
|
@@ -56,9 +56,9 @@ def reset_textbox():
|
|
56 |
with gr.Blocks() as demo:
|
57 |
gr.Markdown(
|
58 |
"# 🤗 Assisted Generation Demo\n"
|
59 |
-
f"- Model: {model_id}\n"
|
60 |
-
f"- Assistant Model: {assistant_id}\n"
|
61 |
-
"- Running on
|
62 |
)
|
63 |
|
64 |
with gr.Row():
|
|
|
9 |
model_id = "HuggingFaceTB/SmolLM-1.7B"
|
10 |
assistant_id = "HuggingFaceTB/SmolLM-135M"
|
11 |
|
12 |
+
model = AutoModelForCausalLM.from_pretrained(model_id).to(dtype=torch.bfloat16, device="cuda")
|
13 |
+
assistant_model = AutoModelForCausalLM.from_pretrained(assistant_id).to(dtype=torch.bfloat16, device="cuda")
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
15 |
|
16 |
@spaces.GPU
|
|
|
56 |
with gr.Blocks() as demo:
|
57 |
gr.Markdown(
|
58 |
"# 🤗 Assisted Generation Demo\n"
|
59 |
+
f"- Model: {model_id} (BF16)\n"
|
60 |
+
f"- Assistant Model: {assistant_id} (BF16)\n"
|
61 |
+
"- Running on a T4 GPU"
|
62 |
)
|
63 |
|
64 |
with gr.Row():
|