Spaces:
Running
Running
Upload 3 files
Browse files- README.md +6 -12
- app.py +23 -0
- requirements.txt +3 -0
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
sdk_version: 5.39.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
# AuthorMist Humanizer App
|
2 |
+
|
3 |
+
This is a Hugging Face Space using the `authormist/authormist-originality` model to humanize AI text.
|
4 |
+
It paraphrases input into more human-like writing, reducing AI detection risk.
|
5 |
+
|
6 |
+
Model Source: https://huggingface.co/authormist/authormist-originality
|
|
|
|
|
|
|
|
|
|
|
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
+
|
4 |
+
model_name = "authormist/authormist-originality"
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
6 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
7 |
+
|
8 |
+
def humanize_text(text):
|
9 |
+
prompt = f"Please paraphrase the following text to make it human-like:\n\n{text}\n\nParaphrased text:"
|
10 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
11 |
+
outputs = model.generate(inputs.input_ids, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
12 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
13 |
+
if "Paraphrased text:" in response:
|
14 |
+
return response.split("Paraphrased text:")[1].strip()
|
15 |
+
return response.strip()
|
16 |
+
|
17 |
+
gr.Interface(
|
18 |
+
fn=humanize_text,
|
19 |
+
inputs=gr.Textbox(lines=10, placeholder="Paste AI-written text here..."),
|
20 |
+
outputs="text",
|
21 |
+
title="AuthorMist AI Humanizer",
|
22 |
+
description="Turns AI-generated text into human-like writing to reduce detection by tools like GPTZero."
|
23 |
+
).launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|
3 |
+
gradio
|