Spaces:
Build error
Build error
asd
Browse files
app.py
CHANGED
@@ -8,10 +8,10 @@ from sentence_splitter import SentenceSplitter
|
|
8 |
from itertools import product
|
9 |
|
10 |
# Get the Hugging Face token from environment variable
|
11 |
-
hf_token = os.getenv('
|
12 |
|
13 |
cuda_available = torch.cuda.is_available()
|
14 |
-
device = torch.device("
|
15 |
print(f"Using device: {device}")
|
16 |
|
17 |
# Initialize paraphraser model and tokenizer
|
@@ -37,7 +37,7 @@ def classify_text(text):
|
|
37 |
main_score = probabilities[0][predicted_class].item()
|
38 |
return main_label, main_score
|
39 |
|
40 |
-
@spaces.GPU
|
41 |
def generate_paraphrases(text, setting, output_format):
|
42 |
sentences = splitter.split(text)
|
43 |
all_sentence_paraphrases = []
|
|
|
8 |
from itertools import product
|
9 |
|
10 |
# Get the Hugging Face token from environment variable
|
11 |
+
hf_token = os.getenv('HF_TOKEN')
|
12 |
|
13 |
cuda_available = torch.cuda.is_available()
|
14 |
+
device = torch.device("cpu" if cuda_available else "cpu")
|
15 |
print(f"Using device: {device}")
|
16 |
|
17 |
# Initialize paraphraser model and tokenizer
|
|
|
37 |
main_score = probabilities[0][predicted_class].item()
|
38 |
return main_label, main_score
|
39 |
|
40 |
+
# @spaces.GPU
|
41 |
def generate_paraphrases(text, setting, output_format):
|
42 |
sentences = splitter.split(text)
|
43 |
all_sentence_paraphrases = []
|