Toumaima commited on
Commit
06a4fb2
·
verified ·
1 Parent(s): ff15be3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -11,6 +11,8 @@ from PIL import Image
11
  from io import BytesIO
12
  import base64
13
  import re
 
 
14
 
15
  # --- Constants ---
16
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
@@ -23,6 +25,8 @@ class BasicAgent:
23
  api_token = os.getenv("HF_TOKEN")
24
 
25
  os.environ["HUGGINGFACEHUB_API_TOKEN"] = "hf_abcdefghijklmnopqrstuvwxyz"
 
 
26
  self.model = InferenceClient("mistralai/Mistral-7B-Instruct-v0.1")
27
  self.tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1") # Initialize tokenizer
28
  SYSTEM_PROMPT = """You are a general AI assistant. I will ask you a question. Report your thoughts, and
 
11
  from io import BytesIO
12
  import base64
13
  import re
14
+ from huggingface_hub import login
15
+
16
 
17
  # --- Constants ---
18
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
25
  api_token = os.getenv("HF_TOKEN")
26
 
27
  os.environ["HUGGINGFACEHUB_API_TOKEN"] = "hf_abcdefghijklmnopqrstuvwxyz"
28
+ login('YOUR_TOKEN')
29
+
30
  self.model = InferenceClient("mistralai/Mistral-7B-Instruct-v0.1")
31
  self.tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1") # Initialize tokenizer
32
  SYSTEM_PROMPT = """You are a general AI assistant. I will ask you a question. Report your thoughts, and