Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
|
5 |
-
device = "cuda:0"
|
6 |
|
7 |
model = pipeline("text-classification", "iknow-lab/ko-flan-zero-v0-0731", device=device)
|
8 |
model.tokenizer.truncation_side = 'left'
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
+
import torch
|
4 |
|
5 |
|
6 |
+
device = "cuda:0" if torch.cuda.is_available() else cpu"
|
7 |
|
8 |
model = pipeline("text-classification", "iknow-lab/ko-flan-zero-v0-0731", device=device)
|
9 |
model.tokenizer.truncation_side = 'left'
|