Spaces:
Sleeping
Sleeping
eljanmahammadli
commited on
Commit
·
42d5442
1
Parent(s):
f75d1f0
using smaller gpt2 for perplexity
Browse files- writing_analysis.py +2 -2
writing_analysis.py
CHANGED
@@ -11,14 +11,14 @@ import plotly.graph_objects as go
|
|
11 |
nltk.download('stopwords')
|
12 |
nltk.download('punkt')
|
13 |
nlp = spacy.load("en_core_web_sm")
|
14 |
-
command = ['python', '-m', 'spacy', 'download', 'en_core_web_sm'
|
15 |
|
16 |
# Execute the command
|
17 |
subprocess.run(command)
|
18 |
|
19 |
# for perplexity
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
-
model_id = "gpt2
|
22 |
model = GPT2LMHeadModel.from_pretrained(model_id).to(device)
|
23 |
tokenizer = GPT2TokenizerFast.from_pretrained(model_id)
|
24 |
|
|
|
11 |
nltk.download('stopwords')
|
12 |
nltk.download('punkt')
|
13 |
nlp = spacy.load("en_core_web_sm")
|
14 |
+
command = ['python', '-m', 'spacy', 'download', 'en_core_web_sm']
|
15 |
|
16 |
# Execute the command
|
17 |
subprocess.run(command)
|
18 |
|
19 |
# for perplexity
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
+
model_id = "gpt2"
|
22 |
model = GPT2LMHeadModel.from_pretrained(model_id).to(device)
|
23 |
tokenizer = GPT2TokenizerFast.from_pretrained(model_id)
|
24 |
|