gstaff commited on
Commit
5c24f69
·
1 Parent(s): 29eeb38

Allow redirects when configuring LCM client.

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -22,10 +22,11 @@ if not HF_TOKEN:
22
  API_URL = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta"
23
  headers = {"Authorization": f"Bearer {HF_TOKEN}"}
24
 
 
25
  def configure_image_client():
26
- url = "https://latent-consistency-super-fast-lcm-lora-sd1-5.hf.space/?view=api"
27
  try:
28
- response = requests.get(url)
29
  response.raise_for_status()
30
  content_text = response.text
31
  pattern = r'"root":"(https://latent-consistency-super-fast-lcm-lora-sd1-5.hf.space/.*?)"'
 
22
  API_URL = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta"
23
  headers = {"Authorization": f"Bearer {HF_TOKEN}"}
24
 
25
+
26
  def configure_image_client():
27
+ url = r"https://latent-consistency-super-fast-lcm-lora-sd1-5.hf.space/"
28
  try:
29
+ response = requests.get(url, params={"view": "api"}, allow_redirects=True)
30
  response.raise_for_status()
31
  content_text = response.text
32
  pattern = r'"root":"(https://latent-consistency-super-fast-lcm-lora-sd1-5.hf.space/.*?)"'