Spaces:
Runtime error
Runtime error
Update game1.py
Browse files
game1.py
CHANGED
@@ -4,6 +4,7 @@ import time
|
|
4 |
import pandas as pd
|
5 |
import gradio as gr
|
6 |
import numpy as np
|
|
|
7 |
|
8 |
def read1(lang, num_selected_former):
|
9 |
if lang in ['en']:
|
@@ -115,6 +116,7 @@ def func1(lang_selected, num_selected, human_predict, num1, num2, user_important
|
|
115 |
from transformers import pipeline
|
116 |
|
117 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
|
|
118 |
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer, device=device)
|
119 |
output = classifier([text['text']])
|
120 |
|
|
|
4 |
import pandas as pd
|
5 |
import gradio as gr
|
6 |
import numpy as np
|
7 |
+
import torch
|
8 |
|
9 |
def read1(lang, num_selected_former):
|
10 |
if lang in ['en']:
|
|
|
116 |
from transformers import pipeline
|
117 |
|
118 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
119 |
+
print(device)
|
120 |
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer, device=device)
|
121 |
output = classifier([text['text']])
|
122 |
|