Skip to content

Commit

Permalink
add login using script
Browse files Browse the repository at this point in the history
  • Loading branch information
SukhmeetSingh2002 committed Oct 1, 2023
1 parent 1da8844 commit df34032
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
from transformers import pipeline
import transformers
import torch
from huggingface_hub import login

import os

class LlamaBot:
def __init__(self):
login(token = os.environ['HF_TOKEN'])
self.model = "meta-llama/Llama-2-7b-chat-hf"
self.tokenizer = AutoTokenizer.from_pretrained(self.model, use_auth_token=True)
self.llama_pipeline = pipeline(
Expand Down

0 comments on commit df34032

Please sign in to comment.