RandomNameAnd6 commited on
Commit
92706a0
1 Parent(s): 8a50e1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,10 +5,10 @@ os.system('pip install --no-deps xformers "trl<0.9.0" peft accelerate bitsandbyt
5
  import gradio as gr
6
  import torch
7
  import random
8
- from transformers import AutoTokenizer, AutoModelForCausalLM
9
 
10
- model, tokenizer = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2-1.5B-bnb-4bit")
11
- model = PeftModel.from_pretrained(model, "RandomNameAnd6/Phi-3-Mini-Dhar-Mann-Adapters-BOS")
12
 
13
  def generate_text(prompt):
14
  input_ids = tokenizer.encode(prompt, return_tensors="pt")
 
5
  import gradio as gr
6
  import torch
7
  import random
8
+ from transformers import GPT2LMHeadModel, GPT2Tokenizer
9
 
10
+ tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
11
+ model = GPT2LMHeadModel.from_pretrained('DharGPT-Small')
12
 
13
  def generate_text(prompt):
14
  input_ids = tokenizer.encode(prompt, return_tensors="pt")