VanguardAI commited on
Commit
ad4a2a0
·
verified ·
1 Parent(s): d22a9c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import torch
2
  import spaces
 
 
3
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
4
  from peft import LoraConfig, PeftModel, get_peft_model
5
  import gradio as gr
@@ -18,7 +20,8 @@ bnb_config = BitsAndBytesConfig(
18
  # Load base model with quantization (replace 'your-username' if needed)
19
  base_model = AutoModelForCausalLM.from_pretrained(
20
  "meta-llama/Meta-Llama-3-8B-Instruct", # Replace with actual base model
21
- quantization_config=bnb_config,
 
22
  )
23
 
24
  # Apply LoRA adapters
 
1
  import torch
2
  import spaces
3
+ import os
4
+ HF_TOKEN = os.environ["HF_TOKEN"]
5
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
6
  from peft import LoraConfig, PeftModel, get_peft_model
7
  import gradio as gr
 
20
  # Load base model with quantization (replace 'your-username' if needed)
21
  base_model = AutoModelForCausalLM.from_pretrained(
22
  "meta-llama/Meta-Llama-3-8B-Instruct", # Replace with actual base model
23
+ quantization_config=bnb_config,
24
+ hf_token=HF_TOKEN,
25
  )
26
 
27
  # Apply LoRA adapters