Spaces:
Runtime error
Runtime error
Weijia Shi
commited on
Commit
·
8ce2218
1
Parent(s):
f72df0a
asd
Browse files
app.py
CHANGED
|
@@ -28,11 +28,11 @@ def calculatePerplexity_gpt3(prompt):
|
|
| 28 |
def check_in_pretraining_data(text):
|
| 29 |
# Check if the input text is longer than 128 words
|
| 30 |
if len(text.split()) < 512:
|
| 31 |
-
return "Error: Your input must be longer than 512 words.", "
|
| 32 |
if text == harry:
|
| 33 |
return "Likely in text-davinci-003's pretraining data", "High confidence"
|
| 34 |
elif text == pineapple:
|
| 35 |
-
return "Likely not in text-davinci-003's pretraining data"
|
| 36 |
text = " ".join(text.split()[:512])
|
| 37 |
pred = {}
|
| 38 |
p1, all_prob, p1_likelihood = calculatePerplexity_gpt3(text)
|
|
|
|
| 28 |
def check_in_pretraining_data(text):
|
| 29 |
# Check if the input text is longer than 128 words
|
| 30 |
if len(text.split()) < 512:
|
| 31 |
+
return "Error: Your input must be longer than 512 words.", ""
|
| 32 |
if text == harry:
|
| 33 |
return "Likely in text-davinci-003's pretraining data", "High confidence"
|
| 34 |
elif text == pineapple:
|
| 35 |
+
return "Likely not in text-davinci-003's pretraining data", "High confidence"
|
| 36 |
text = " ".join(text.split()[:512])
|
| 37 |
pred = {}
|
| 38 |
p1, all_prob, p1_likelihood = calculatePerplexity_gpt3(text)
|