Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
from transformers import pipeline
|
|
|
4 |
|
|
|
5 |
model = pipeline(
|
6 |
"text-generation",
|
7 |
model="unsloth/DeepSeek-R1-Distill-Llama-8B",
|
8 |
device_map="auto",
|
9 |
-
torch_dtype=torch.float16, #
|
10 |
-
model_kwargs={"load_in_8bit": True}
|
11 |
)
|
12 |
|
13 |
@spaces.GPU(duration=300) # Increased to 5 minutes
|
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
from transformers import pipeline
|
4 |
+
import torch
|
5 |
|
6 |
+
# Initialize model with explicit dtype
|
7 |
model = pipeline(
|
8 |
"text-generation",
|
9 |
model="unsloth/DeepSeek-R1-Distill-Llama-8B",
|
10 |
device_map="auto",
|
11 |
+
torch_dtype=torch.float16, # Now recognizes 'torch'
|
12 |
+
model_kwargs={"load_in_8bit": True}
|
13 |
)
|
14 |
|
15 |
@spaces.GPU(duration=300) # Increased to 5 minutes
|