subashpoudel commited on
Commit
32131c3
·
1 Parent(s): 72a7f4f

Debugged the unmatched f-string

Browse files
my_agent/utils/models_loader.py CHANGED
@@ -27,7 +27,7 @@ class HFEmbeddingAPI:
27
  def __init__(self, api_url, token):
28
  self.api_url = api_url
29
  self.headers = {
30
- "Authorization": f"Bearer {os.environ.get("HUGGINGFACEHUB_ACCESS_TOKEN")}",
31
  }
32
 
33
  def encode(self, texts):
@@ -45,7 +45,7 @@ class HFEmbeddingAPI:
45
  # Instantiate your API-backed "SentenceTransformer"
46
  ST = HFEmbeddingAPI(
47
  api_url="https://router.huggingface.co/hf-inference/models/mixedbread-ai/mxbai-embed-large-v1/pipeline/feature-extraction",
48
- token=os.environ.get("HUGGINGFACEHUB_ACCESS_TOKEN")
49
  )
50
 
51
 
 
27
  def __init__(self, api_url, token):
28
  self.api_url = api_url
29
  self.headers = {
30
+ "Authorization": f"Bearer {os.environ.get('HUGGINGFACEHUB_ACCESS_TOKEN')}",
31
  }
32
 
33
  def encode(self, texts):
 
45
  # Instantiate your API-backed "SentenceTransformer"
46
  ST = HFEmbeddingAPI(
47
  api_url="https://router.huggingface.co/hf-inference/models/mixedbread-ai/mxbai-embed-large-v1/pipeline/feature-extraction",
48
+ token=os.environ.get('HUGGINGFACEHUB_ACCESS_TOKEN')
49
  )
50
 
51
 
my_agent/utils/nodes.py CHANGED
@@ -14,7 +14,7 @@ def caption_image(state: State) -> State:
14
  if len(state.images)>0:
15
  if state.images[-1]!=None:
16
  print('Captioning image')
17
- client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
18
 
19
  chat_completion = client.chat.completions.create(
20
  messages=[
 
14
  if len(state.images)>0:
15
  if state.images[-1]!=None:
16
  print('Captioning image')
17
+ client = Groq(api_key=os.environ.get('GROQ_API_KEY'))
18
 
19
  chat_completion = client.chat.completions.create(
20
  messages=[
my_agent/utils/utils.py CHANGED
@@ -60,7 +60,7 @@ def generate_image(final_story):
60
 
61
  client = InferenceClient(
62
  provider="hf-inference",
63
- api_key=os.environ.get("HUGGINGFACEHUB_ACCESS_TOKEN"),
64
  )
65
 
66
  print('************Finished calling generator****************')
 
60
 
61
  client = InferenceClient(
62
  provider="hf-inference",
63
+ api_key=os.environ.get('HUGGINGFACEHUB_ACCESS_TOKEN'),
64
  )
65
 
66
  print('************Finished calling generator****************')