HF_API_TTI_BASE env variable

Hi Everyone
I’m trying to run ‘L3_Image_generation_app.ipynb’ locally.
The endpoint is read from the env variable ‘HF_API_TTI_BASE’

ENDPOINT_URL=os.environ[‘HF_API_TTI_BASE’]

Which is the value of this variable?
Is there any workaround to avoid the env variable and connect directly to the model ENDPOINT?

At the moment I got the following error:


KeyError Traceback (most recent call last)
Cell In[2], line 5
2 import requests, json
4 #Text-to-image endpoint
----> 5 def get_completion(inputs, parameters=None, ENDPOINT_URL=os.environ[‘HF_API_TTI_BASE’]):
6 headers = {
7 “Authorization”: f"Bearer {hf_api_key}",
8 “Content-Type”: “application/json”
9 }
10 data = { “inputs”: inputs }

File :679, in getitem(self, key)

KeyError: ‘HF_API_TTI_BASE’
Thanks in advance.
Fabio

Yup, instructions in this course is very vague… It should have been more clear and precise…

I got this api url by following below steps :

  1. Copy model name used : Which is Salesforce/blip-image-captioning-base.
  2. Go To : https://huggingface.co/models and search for above model : Salesforce/blip-image-captioning-base
  3. Open that model
  4. Click on Deploy. You will see an option Interface API
  5. Clicking on that will reveal API_URL which is free to use directly in your project.