minhdang commited on
Commit
02596d2
1 Parent(s): 8345308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -4,9 +4,9 @@ import transformers
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig,AwqConfig
5
  import torch
6
  import os
7
- # key = os.environ.get("key")
8
  from huggingface_hub import login
9
- # login(key)
10
 
11
 
12
  nf4_config = BitsAndBytesConfig(
@@ -16,12 +16,12 @@ nf4_config = BitsAndBytesConfig(
16
  bnb_4bit_compute_dtype=torch.bfloat16
17
  )
18
 
19
- model_id = "CohereForAI/c4ai-command-r-v01"
20
  tokenizer = AutoTokenizer.from_pretrained(model_id)
21
  model = AutoModelForCausalLM.from_pretrained(model_id,
22
  # load_in_8bit=True,
23
- quantization_config=nf4_config,
24
- # torch_dtype = torch.bfloat16,
25
  device_map="auto"
26
  )
27
 
 
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig,AwqConfig
5
  import torch
6
  import os
7
+ key = os.environ.get("key")
8
  from huggingface_hub import login
9
+ login(key)
10
 
11
 
12
  nf4_config = BitsAndBytesConfig(
 
16
  bnb_4bit_compute_dtype=torch.bfloat16
17
  )
18
 
19
+ model_id = "Viet-Mistral/Vistral-7B-Chat"
20
  tokenizer = AutoTokenizer.from_pretrained(model_id)
21
  model = AutoModelForCausalLM.from_pretrained(model_id,
22
  # load_in_8bit=True,
23
+ # quantization_config=nf4_config,
24
+ torch_dtype = torch.bfloat16,
25
  device_map="auto"
26
  )
27