ariG23498 HF staff commited on
Commit
a3f8683
1 Parent(s): 33a95fe

chore: fixing secrets

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,11 +4,12 @@ import torch
4
  from datasets import load_dataset
5
  from sentence_transformers import SentenceTransformer
6
  from transformers import AutoTokenizer, AutoModelForCausalLM
 
7
 
8
  dataset = load_dataset("ariG23498/pis-blogs-chunked")
9
  embedding_model = SentenceTransformer(model_name_or_path="all-mpnet-base-v2")
10
- tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it")
11
- model = AutoModelForCausalLM.from_pretrained("google/gemma-2b-it", torch_dtype=torch.bfloat16)
12
 
13
  @spaces.GPU
14
  def process_query(query):
 
4
  from datasets import load_dataset
5
  from sentence_transformers import SentenceTransformer
6
  from transformers import AutoTokenizer, AutoModelForCausalLM
7
+ import os
8
 
9
  dataset = load_dataset("ariG23498/pis-blogs-chunked")
10
  embedding_model = SentenceTransformer(model_name_or_path="all-mpnet-base-v2")
11
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it", key="HF_TOKEN", value=os.getenv["auth"])
12
+ model = AutoModelForCausalLM.from_pretrained("google/gemma-2b-it", torch_dtype=torch.bfloat16, key="HF_TOKEN", value=os.getenv["auth"])
13
 
14
  @spaces.GPU
15
  def process_query(query):