Spaces:
Sleeping
Sleeping
Update app.py
Browse files12 unmodified lines131415161718161718192013 unmodified lines343536383738394041434445424344454647484912 unmodified linesapp = Flask(__name__)CORS(app)
# --- LOAD THE AI MODEL ---# We use 'Vamsi/T5_Paraphrase_Paws' which is excellent for humanizing text.MODEL_NAME = "Vamsi/T5_Paraphrase_Paws"# --- 1. NEW MODEL (Better for humanizing) ---MODEL_NAME = "humarin/chatgpt_paraphraser_on_T5_base"device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Loading AI Model: {MODEL_NAME} on {device}...")13 unmodified lines input_ids = encoding["input_ids"].to(device) attention_masks = encoding["attention_mask"].to(device)
# Generate paraphrase # --- 2. ANTI-DETECTION SETTINGS (The Secret Sauce) --- outputs = model.generate( input_ids=input_ids, attention_mask=attention_masks, max_length=256, do_sample=True, # Randomness for "human" feel top_k=120, top_p=0.95, do_sample=True, # Enable randomness temperature=1.2, # HIGHER TEMP = More "Human/Creative" (Risky) top_k=60, # Lower top_k forces it to consider rare words top_p=0.90, # Slightly tighter probability spread repetition_penalty=1.3, # Force it to NOT repeat words (Humans don't repeat) early_stopping=True, num_return_sequences=1 )app.py+8-7