Jesivn commited on
Commit
4e34f1d
1 Parent(s): 4cabd31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -16,11 +16,14 @@ translator = pipeline("translation", model="Helsinki-NLP/opus-mt-dra-en")
16
  summarizer = pipeline("summarization", model="Falconsai/text_summarization")
17
  # image_pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.float16).to("cpu")
18
 
19
- API_URL = "https://api-inference.huggingface.co/models/ZB-Tech/Text-to-Image"
20
- headers = {"Authorization": f"Bearer {os.getenv('HF_API_TOKEN')}"}
 
 
 
21
 
22
  def query(payload):
23
- response = requests.post(API_URL, headers=headers, json=payload)
24
  return response.content
25
 
26
 
 
16
  summarizer = pipeline("summarization", model="Falconsai/text_summarization")
17
  # image_pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.float16).to("cpu")
18
 
19
+
20
+
21
+ # for image api
22
+ IMAGE_API_URL = "https://api-inference.huggingface.co/models/ZB-Tech/Text-to-Image"
23
+ img_headers = {"Authorization": f"Bearer {os.getenv('HF_API_TOKEN')}"}
24
 
25
  def query(payload):
26
+ response = requests.post(IMAGE_API_URL, headers=img_headers, json=payload)
27
  return response.content
28
 
29