Downloads · 30 days
17
24% of all-time downloads
rjx76/reddit-chatbot-model
reddit-chatbot-model is a text generation model from rjx76. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This is a causal language model fine-tuned from [BASEMODELNAME] on comments collected from the r/[TARGETSUBREDDIT] subreddit. It's intended to generate conversational text mimicking the style and topics found in that…
Downloads · 30 days
17
24% of all-time downloads
All-time downloads
70
Public
Parameters
355M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
This is a causal language model fine-tuned from [BASE_MODEL_NAME] on comments collected from the r/[TARGET_SUBREDDIT] subreddit. It's intended to generate conversational text mimicking the style and topics found in that community.
This model is a fine-tuned version of the [BASE_MODEL_NAME] transformer model. It was trained on a dataset of comments fetched from the r/[TARGET_SUBREDDIT] subreddit using the PRAW library. The goal was to adapt the base model to generate responses in a style characteristic of conversations within that specific online community.
en). The dataset sourced from Reddit may contain other languages or slang specific to the community.[BASE_MODEL_NAME] model: [Link to Base Model License]. Note that the training data comes from Reddit and is subject to Reddit's User Agreement and Content Policy. Users must comply with Reddit's terms when using this model or the data.[BASE_MODEL_NAME] (e.g., microsoft/DialoGPT-medium or gpt2)https://huggingface.co/[Your Hugging Face Username]/[Your Model Repository Name]This model is intended for generating conversational text, simulating responses one might find in the r/[TARGET_SUBREDDIT] subreddit. It can be used directly with the transformers library pipeline for text generation or through manual generation loops for more control.
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
import torch
# Using pipeline (simple)
pipe = pipeline("text-generation", model="[Your Hugging Face Username]/[Your Model Repository Name]", device=0 if torch.cuda.is_available() else -1)
prompt = "What are your thoughts on " # Example prompt
response = pipe(prompt, max_new_tokens=50, num_return_sequences=1)
print(response[0]['generated_text'])
# Manual usage (more control, similar to script's chat)
tokenizer = AutoTokenizer.from_pretrained("[Your Hugging Face Username]/[Your Model Repository Name]")
model = AutoModelForCausalLM.from_pretrained("[Your Hugging Face Username]/[Your Model Repository Name]")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
prompt = "The best thing about [topic relevant to subreddit] is "
inputs = tokenizer.encode(prompt + tokenizer.eos_token, return_tensors='pt').to(device)
# Example generation parameters (adjust as needed)
outputs = model.generate(
inputs,
max_new_tokens=100,
do_sample=True,
top_k=50,
top_p=0.92,
temperature=0.75,
pad_token_id=tokenizer.eos_token_id
)
response_text = tokenizer.decode(outputs[0, inputs.shape[-1]:], skip_special_tokens=True)
print(f"Prompt: {prompt}")
print(f"Bot: {response_text}")