Delete local_infer.py
Browse files- local_infer.py +0 -24
local_infer.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
This code a slight modification of perplexity by hugging face
|
| 3 |
-
https://huggingface.co/docs/transformers/perplexity
|
| 4 |
-
|
| 5 |
-
Both this code and the orignal code are published under the MIT license.
|
| 6 |
-
|
| 7 |
-
by Burhan Ul tayyab and Nicholas Chua
|
| 8 |
-
"""
|
| 9 |
-
|
| 10 |
-
from model import GPT2PPL
|
| 11 |
-
|
| 12 |
-
# initialize the model
|
| 13 |
-
model = GPT2PPL()
|
| 14 |
-
|
| 15 |
-
print("Please enter your sentence: (Press Enter twice to start processing)")
|
| 16 |
-
contents = []
|
| 17 |
-
while True:
|
| 18 |
-
line = input()
|
| 19 |
-
if len(line) == 0:
|
| 20 |
-
break
|
| 21 |
-
contents.append(line)
|
| 22 |
-
sentence = "\n".join(contents)
|
| 23 |
-
|
| 24 |
-
model(sentence)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|