Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,9 +9,9 @@ def on_first_button_click():
|
|
9 |
return gr.update(visible=True)
|
10 |
|
11 |
def ai_article_generator(
|
12 |
-
topic, text_type, length, ai_model, api = None
|
13 |
):
|
14 |
-
prompt = f"Write a {text_type} about the topic in about {length} words: {topic}"
|
15 |
print(prompt)
|
16 |
ai_text = generate(f"Write an article about the topic: {prompt}", ai_model, api)
|
17 |
return ai_text
|
@@ -72,7 +72,7 @@ def ai_generated_test_copyleak(text):
|
|
72 |
'Accept': "application/json"
|
73 |
}
|
74 |
scanID = "9ea35187-f43a-4dc2-bfdf-25825b78eaf1"
|
75 |
-
conn.request("POST", f"/v2/writer-detector/{
|
76 |
|
77 |
res = conn.getresponse()
|
78 |
data = res.read()
|
@@ -107,7 +107,13 @@ with gr.Blocks() as demo:
|
|
107 |
input_text_type = gr.Dropdown(
|
108 |
choices = ['article', 'essay', 'blog', 'report', 'letter'],
|
109 |
value = 'article',
|
110 |
-
label="Choose
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
)
|
112 |
with gr.Column():
|
113 |
input_length = gr.Number(value=200, label="Choose length of the text:")
|
@@ -181,6 +187,7 @@ with gr.Blocks() as demo:
|
|
181 |
inputs=[
|
182 |
input_topic,
|
183 |
input_text_type,
|
|
|
184 |
input_length,
|
185 |
ai_generator,
|
186 |
input_api
|
|
|
9 |
return gr.update(visible=True)
|
10 |
|
11 |
def ai_article_generator(
|
12 |
+
topic, text_type, tonality, length, ai_model, api = None
|
13 |
):
|
14 |
+
prompt = f"Write a {text_type} about the topic in about {length} words using a {tonality} tone: {topic}"
|
15 |
print(prompt)
|
16 |
ai_text = generate(f"Write an article about the topic: {prompt}", ai_model, api)
|
17 |
return ai_text
|
|
|
72 |
'Accept': "application/json"
|
73 |
}
|
74 |
scanID = "9ea35187-f43a-4dc2-bfdf-25825b78eaf1"
|
75 |
+
conn.request("POST", f"/v2/writer-detector/{scanID}/check", payload, headers)
|
76 |
|
77 |
res = conn.getresponse()
|
78 |
data = res.read()
|
|
|
107 |
input_text_type = gr.Dropdown(
|
108 |
choices = ['article', 'essay', 'blog', 'report', 'letter'],
|
109 |
value = 'article',
|
110 |
+
label="Choose text type of text:"
|
111 |
+
)
|
112 |
+
with gr.Column():
|
113 |
+
input_tonality = gr.Dropdown(
|
114 |
+
choices = ["casual", "professional", "formal", "friendly", "humorous"],
|
115 |
+
value = 'casual',
|
116 |
+
label="Choose tonality of text:"
|
117 |
)
|
118 |
with gr.Column():
|
119 |
input_length = gr.Number(value=200, label="Choose length of the text:")
|
|
|
187 |
inputs=[
|
188 |
input_topic,
|
189 |
input_text_type,
|
190 |
+
input_tonality,
|
191 |
input_length,
|
192 |
ai_generator,
|
193 |
input_api
|