pentesting / pentesting_assistant.py
vendetta25's picture
Upload 6 files
13034c5 verified
raw
history blame
657 Bytes
from transformers import pipeline, AlbertTokenizer, AlbertForSequenceClassification
# Load model
model = AlbertForSequenceClassification.from_pretrained('./pentesting_albert_model')
tokenizer = AlbertTokenizer.from_pretrained('./pentesting_albert_model')
# Create text-generation pipeline
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
while True:
user_input = input("Kamu: ")
if user_input.lower() == "keluar":
break
# Generate response
response = generator(user_input, max_length=50, num_return_sequences=1, do_sample=True, top_k=50, top_p=0.95)
print("Asisten: ", response[0]['generated_text'])