Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from gradio_client import Client
|
|
4 |
from ai_generate import generate
|
5 |
import requests
|
6 |
import http.client
|
|
|
7 |
|
8 |
def on_first_button_click():
|
9 |
return gr.update(visible=True)
|
@@ -64,7 +65,7 @@ def ai_generated_test_sapling(text):
|
|
64 |
def ai_generated_test_copyleak(text):
|
65 |
|
66 |
conn = http.client.HTTPSConnection("api.copyleaks.com")
|
67 |
-
payload = {"text": text}
|
68 |
|
69 |
headers = {
|
70 |
'Authorization': "",
|
@@ -80,6 +81,7 @@ def ai_generated_test_copyleak(text):
|
|
80 |
print(data.decode("utf-8")["results"]["summary"])
|
81 |
return data.decode("utf-8")["results"]["summary"]
|
82 |
|
|
|
83 |
def ai_check(text, option):
|
84 |
if option == 'Polygraf AI':
|
85 |
return ai_generated_test_polygraf(text)
|
|
|
4 |
from ai_generate import generate
|
5 |
import requests
|
6 |
import http.client
|
7 |
+
import json
|
8 |
|
9 |
def on_first_button_click():
|
10 |
return gr.update(visible=True)
|
|
|
65 |
def ai_generated_test_copyleak(text):
|
66 |
|
67 |
conn = http.client.HTTPSConnection("api.copyleaks.com")
|
68 |
+
payload = payload = "{\n \"text\": \"" + text + "\"\n}"
|
69 |
|
70 |
headers = {
|
71 |
'Authorization': "",
|
|
|
81 |
print(data.decode("utf-8")["results"]["summary"])
|
82 |
return data.decode("utf-8")["results"]["summary"]
|
83 |
|
84 |
+
|
85 |
def ai_check(text, option):
|
86 |
if option == 'Polygraf AI':
|
87 |
return ai_generated_test_polygraf(text)
|