davanstrien HF staff commited on
Commit
5e571ea
1 Parent(s): 7fbe657
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -11,8 +11,8 @@ import random
11
  import os
12
  from pathlib import Path
13
 
14
- # Ensure you're logged in to Hugging Face
15
- login(get_token())
16
  # Define available models
17
  MODELS = [
18
  "meta-llama/Meta-Llama-3-70B-Instruct",
@@ -84,14 +84,14 @@ def get_random_model():
84
  def create_client(model_id):
85
  return OpenAI(
86
  base_url=f"https://api-inference.huggingface.co/models/{model_id}/v1",
87
- api_key=get_token(),
88
  )
89
 
90
 
91
- client = OpenAI(
92
- base_url="https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-70B-Instruct/v1",
93
- api_key=get_token(),
94
- )
95
 
96
 
97
  def generate_prompt():
 
11
  import os
12
  from pathlib import Path
13
 
14
+ HF_TOKEN = os.getenv("HF_TOKEN")
15
+
16
  # Define available models
17
  MODELS = [
18
  "meta-llama/Meta-Llama-3-70B-Instruct",
 
84
  def create_client(model_id):
85
  return OpenAI(
86
  base_url=f"https://api-inference.huggingface.co/models/{model_id}/v1",
87
+ api_key=HF_TOKEN,
88
  )
89
 
90
 
91
+ # client = OpenAI(
92
+ # base_url="https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-70B-Instruct/v1",
93
+ # api_key=HF_TOKEN
94
+ # )
95
 
96
 
97
  def generate_prompt():