Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,13 @@ import io
|
|
4 |
from PIL import Image
|
5 |
import gradio as gr
|
6 |
import tempfile
|
|
|
7 |
|
|
|
8 |
recipe_generator = pipeline("text2text-generation", model="flax-community/t5-recipe-generation")
|
9 |
|
10 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
11 |
-
headers = {'Authorization': f'Bearer
|
12 |
|
13 |
def query(payload):
|
14 |
response = requests.post(API_URL, headers=headers, json=payload)
|
|
|
4 |
from PIL import Image
|
5 |
import gradio as gr
|
6 |
import tempfile
|
7 |
+
import os
|
8 |
|
9 |
+
HF = os.getenv("HF_SECRET")
|
10 |
recipe_generator = pipeline("text2text-generation", model="flax-community/t5-recipe-generation")
|
11 |
|
12 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
13 |
+
headers = {'Authorization': f'Bearer {HF}'}
|
14 |
|
15 |
def query(payload):
|
16 |
response = requests.post(API_URL, headers=headers, json=payload)
|