Downloads · 30 days
45
2% of all-time downloads
RichardErkhov/KhantKyaw_-_Chat_GPT-2-gguf
KhantKyaw_-_Chat_GPT-2-gguf is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
45
2% of all-time downloads
All-time downloads
2.8K
Public
Repo size
2.1 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.4 GB · 100%
From the Hugging Face model README
Quantization made by Richard Erkhov.
Chat_GPT-2 - GGUF
| Name | Quant method | Size |
|---|---|---|
| Chat_GPT-2.Q2_K.gguf | Q2_K | 0.08GB |
| Chat_GPT-2.IQ3_XS.gguf | IQ3_XS | 0.08GB |
| Chat_GPT-2.IQ3_S.gguf | IQ3_S | 0.08GB |
| Chat_GPT-2.Q3_K_S.gguf | Q3_K_S | 0.08GB |
| Chat_GPT-2.IQ3_M.gguf | IQ3_M | 0.09GB |
| Chat_GPT-2.Q3_K.gguf | Q3_K | 0.09GB |
| Chat_GPT-2.Q3_K_M.gguf | Q3_K_M | 0.09GB |
| Chat_GPT-2.Q3_K_L.gguf | Q3_K_L | 0.1GB |
| Chat_GPT-2.IQ4_XS.gguf | IQ4_XS | 0.1GB |
| Chat_GPT-2.Q4_0.gguf | Q4_0 | 0.1GB |
| Chat_GPT-2.IQ4_NL.gguf | IQ4_NL | 0.1GB |
| Chat_GPT-2.Q4_K_S.gguf | Q4_K_S | 0.1GB |
| Chat_GPT-2.Q4_K.gguf | Q4_K | 0.11GB |
| Chat_GPT-2.Q4_K_M.gguf | Q4_K_M | 0.11GB |
| Chat_GPT-2.Q4_1.gguf | Q4_1 | 0.11GB |
| Chat_GPT-2.Q5_0.gguf | Q5_0 | 0.11GB |
| Chat_GPT-2.Q5_K_S.gguf | Q5_K_S | 0.11GB |
| Chat_GPT-2.Q5_K.gguf | Q5_K | 0.12GB |
| Chat_GPT-2.Q5_K_M.gguf | Q5_K_M | 0.12GB |
| Chat_GPT-2.Q5_1.gguf | Q5_1 | 0.12GB |
| Chat_GPT-2.Q6_K.gguf | Q6_K | 0.13GB |
| Chat_GPT-2.Q8_0.gguf | Q8_0 | 0.17GB |
Original model description:
from transformers import GPT2Tokenizer, GPT2LMHeadModel
def generate_response(input_text):
inputs = tokenizer(input_text, return_tensors="pt")
output_sequences = model.generate(
input_ids=inputs['input_ids'],
attention_mask=inputs['attention_mask'],
max_length=100, # Adjusted max_length
temperature=0.3,
top_k=40,
top_p=0.85,
num_return_sequences=1,
no_repeat_ngram_size=2,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
early_stopping=True,
do_sample=True,
use_cache=True,
)
full_generated_text = tokenizer.decode(output_sequences[0], skip_special_tokens=True)
bot_response_start = full_generated_text.find('[Bot]') + len('[Bot]')
bot_response = full_generated_text[bot_response_start:]
return bot_response
model_name = 'KhantKyaw/Chat_GPT-2'
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
model = GPT2LMHeadModel.from_pretrained(model_name)
response = generate_response(user_input)
print("Chatbot:", response)