article_writer / stress_test.py
eljanmahammadli's picture
fix reference new line
da88846
from gradio_client import Client, file, handle_file
client = Client("http://sd.demo.polygraf.ai:7890/")
generated_text = client.predict(
input_role="Student",
topic="Low Resource Language Models",
keywords="",
article_length=400,
format="Article",
writing_style="Formal",
tone="Professional",
user_category="General Public",
depth_of_content="Moderate analysis",
structure="Introduction, Body, Conclusion",
references="News outlets",
num_examples="1-2",
conclusion_type="Call to Action",
# ai_model="OpenAI GPT 4o Mini",
ai_model="LLaMA 3",
google_search_check=True,
year_from="2000",
month_from="January",
day_from="01",
year_to="2024",
month_to="August",
day_to="08",
domains_to_include=["com", "org", "net", "int", "edu", "gov", "mil"],
include_sites="",
exclude_sites="",
pdf_file_input=[handle_file("/home/eljan/article_writer/Abstract.pdf")],
api_name="/generate_and_format",
)
client.predict(text="Polygraf AI (Advanced Model)", api_name="/highlight_visible_1")
detect_generated = client.predict(
text=generated_text,
option="Polygraf AI (Advanced Model)",
api_name="/ai_check",
)
humanized_text = client.predict(
text=generated_text,
model="XL Model",
temperature=1.2,
repetition_penalty=1,
top_k=50,
length_penalty=1,
api_name="/humanize",
)
client.predict(text="Polygraf AI (Advanced Model)", api_name="/highlight_visible_1")
detect_humanized = client.predict(
text=humanized_text,
option="Polygraf AI (Advanced Model)",
api_name="/ai_check",
)
print(detect_generated)
print(detect_humanized)