Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
pipe = pipeline(
|
5 |
"text-generation",
|
6 |
model="agentica-org/DeepCoder-14B-Preview",
|
7 |
-
device="cuda" if torch.cuda.is_available() else "cpu"
|
8 |
)
|
9 |
|
10 |
def chat(message, history):
|
|
|
1 |
+
import torch # <-- Add this line
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
pipe = pipeline(
|
6 |
"text-generation",
|
7 |
model="agentica-org/DeepCoder-14B-Preview",
|
8 |
+
device="cuda" if torch.cuda.is_available() else "cpu" # Now torch is defined
|
9 |
)
|
10 |
|
11 |
def chat(message, history):
|