Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def predict(query, device="cpu"):
|
|
| 44 |
probs = logits.softmax(dim=-1)
|
| 45 |
|
| 46 |
fake, real = probs.detach().cpu().flatten().numpy().tolist()
|
| 47 |
-
return
|
| 48 |
|
| 49 |
def findRealProb(text):
|
| 50 |
chunksOfText = (chunks_of_600(text))
|
|
@@ -57,7 +57,7 @@ def findRealProb(text):
|
|
| 57 |
for prob, length in results:
|
| 58 |
ans = ans + prob*length
|
| 59 |
realProb = ans/len(text)
|
| 60 |
-
return
|
| 61 |
|
| 62 |
demo = gr.Interface(
|
| 63 |
fn=findRealProb,
|
|
|
|
| 44 |
probs = logits.softmax(dim=-1)
|
| 45 |
|
| 46 |
fake, real = probs.detach().cpu().flatten().numpy().tolist()
|
| 47 |
+
return real
|
| 48 |
|
| 49 |
def findRealProb(text):
|
| 50 |
chunksOfText = (chunks_of_600(text))
|
|
|
|
| 57 |
for prob, length in results:
|
| 58 |
ans = ans + prob*length
|
| 59 |
realProb = ans/len(text)
|
| 60 |
+
return {"Real": real, "Fake": 1-real}
|
| 61 |
|
| 62 |
demo = gr.Interface(
|
| 63 |
fn=findRealProb,
|