Jaane commited on
Commit
5a7f9d2
·
verified ·
1 Parent(s): 84abc16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,13 +13,13 @@ os.environ['TRANSFORMERS_NO_ADVISORY_WARNINGS'] = '1'
13
  torch.manual_seed(1234)
14
  if torch.cuda.is_available():
15
  torch.cuda.manual_seed_all(1234)
16
- #device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
17
- #print(f"Using device: {device}")
18
 
19
 
20
  # Initialize Parrot model
21
  parrot = Parrot(model_tag="prithivida/parrot_paraphraser_on_T5")
22
- #parrot.model.to(device)
23
  # Function to paraphrase a single sentence
24
  def paraphrase_sentence(sentence):
25
  paraphrases = parrot.augment(input_phrase=sentence, max_return_phrases=10, max_length=100, adequacy_threshold=0.75, fluency_threshold=0.75)
 
13
  torch.manual_seed(1234)
14
  if torch.cuda.is_available():
15
  torch.cuda.manual_seed_all(1234)
16
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
17
+ print(f"Using device: {device}")
18
 
19
 
20
  # Initialize Parrot model
21
  parrot = Parrot(model_tag="prithivida/parrot_paraphraser_on_T5")
22
+ parrot.model.to(device)
23
  # Function to paraphrase a single sentence
24
  def paraphrase_sentence(sentence):
25
  paraphrases = parrot.augment(input_phrase=sentence, max_return_phrases=10, max_length=100, adequacy_threshold=0.75, fluency_threshold=0.75)