Views
No views yet
EleutherAI/pythia-70m-deduped model, specifically adapted for tasks related to sarcasm.EleutherAI/pythia-70m-deduped model. It has been fine-tuned on a dataset related to sarcasm. As a Causal Language Model (CLM), its primary function is to predict the next token in a sequence. This fine-tuning aims to imbue the model with an understanding or stylistic representation of sarcastic language.EleutherAI/pythia-70m-deduped)EleutherAI/pythia-70m-dedupedhttps://huggingface.co/manny-uncharted/pythia-70m-sarcasm-lora (based on hf_target_model_repo_id)https://huggingface.co/EleutherAI/pythia-70m-dedupedEleutherAI/pythia-70m-deduped base model. It can be used for:EleutherAI/pythia-70m-deduped base model, which was trained on The Pile. These can include societal, gender, and racial biases.eval_loss: nan was observed, indicating potential issues with evaluation on the tiny validation set or numerical instability under the given configuration. The train_loss: 0.0 also suggests extreme overfitting or issues with the learning process on such limited data.1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3import torch
4
5base_model_id = "EleutherAI/pythia-70m-deduped"
6adapter_model_id = "manny-uncharted/pythia-70m-sarcasm-lora" # Replace with your actual model ID
7
8# Load the tokenizer
9tokenizer = AutoTokenizer.from_pretrained(base_model_id)
10if tokenizer.pad_token is None:
11 tokenizer.pad_token = tokenizer.eos_token
12
13# Load the base model (e.g., in 4-bit if that's how the adapter was trained/intended)
14# For QLoRA, BitsAndBytesConfig would be needed here as during training
15# For simplicity, this example loads without quantization. Adapt as needed.
16base_model = AutoModelForCausalLM.from_pretrained(
17 base_model_id,
18 # quantization_config=BitsAndBytesConfig(...) # Add if loading in 4-bit/8-bit
19 # torch_dtype=torch.float16, # Or torch.bfloat16
20 device_map="auto"
21)
22
23# Load the PEFT LoRA model (adapter)
24model = PeftModel.from_pretrained(base_model, adapter_model_id)
25model = model.merge_and_unload() # Optional: merge adapter into base model for faster inference
26
27# Now you can use the model for generation
28prompt = "The weather today is just " # Example prompt
29inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
30
31# Generate text
32# Adjust generation parameters as needed
33outputs = model.generate(**inputs, max_new_tokens=50, do_sample=True, top_k=50, top_p=0.95, temperature=0.7)
34print(tokenizer.decode(outputs[0], skip_special_tokens=True))