CreitinGameplays commited on
Commit
8d2503f
·
verified ·
1 Parent(s): 320c272

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import torch
3
  import bitsandbytes as bnb
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
5
 
 
6
  # BNB config
7
  bnb_config = BitsAndBytesConfig(
8
  load_in_4bit=True,
@@ -11,12 +12,15 @@ bnb_config = BitsAndBytesConfig(
11
  bnb_4bit_compute_dtype=torch.bfloat16
12
  )
13
 
 
 
 
14
  # Define the BLOOM model name
15
  model_name = "CreitinGameplays/bloom-3b-conversational"
16
 
17
  # Load tokenizer and model
18
  tokenizer = AutoTokenizer.from_pretrained(model_name)
19
- model = AutoModelForCausalLM.from_pretrained(model_name, quantization_config=bnb_config)
20
 
21
  def generate_text(user_prompt):
22
  """Generates text using the BLOOM model from Hugging Face Transformers and removes the user prompt."""
 
3
  import bitsandbytes as bnb
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
5
 
6
+ """
7
  # BNB config
8
  bnb_config = BitsAndBytesConfig(
9
  load_in_4bit=True,
 
12
  bnb_4bit_compute_dtype=torch.bfloat16
13
  )
14
 
15
+ quantization_config=bnb_config
16
+ """
17
+
18
  # Define the BLOOM model name
19
  model_name = "CreitinGameplays/bloom-3b-conversational"
20
 
21
  # Load tokenizer and model
22
  tokenizer = AutoTokenizer.from_pretrained(model_name)
23
+ model = AutoModelForCausalLM.from_pretrained(model_name)
24
 
25
  def generate_text(user_prompt):
26
  """Generates text using the BLOOM model from Hugging Face Transformers and removes the user prompt."""