Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- api/index.py +3 -5
api/index.py
CHANGED
@@ -21,11 +21,8 @@ load_dotenv(dotenv_path)
|
|
21 |
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
22 |
REPLICATE_API_TOKEN = os.getenv('REPLICATE_API_TOKEN')
|
23 |
|
24 |
-
|
25 |
-
|
26 |
client = OpenAI()
|
27 |
|
28 |
-
|
29 |
def call_openai(pil_image):
|
30 |
# Save the PIL image to a bytes buffer
|
31 |
buffered = io.BytesIO()
|
@@ -132,5 +129,6 @@ def image_classifier(moodboard, starter_image, image_strength, prompt):
|
|
132 |
|
133 |
return images
|
134 |
|
135 |
-
|
136 |
-
demo.
|
|
|
|
21 |
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
22 |
REPLICATE_API_TOKEN = os.getenv('REPLICATE_API_TOKEN')
|
23 |
|
|
|
|
|
24 |
client = OpenAI()
|
25 |
|
|
|
26 |
def call_openai(pil_image):
|
27 |
# Save the PIL image to a bytes buffer
|
28 |
buffered = io.BytesIO()
|
|
|
129 |
|
130 |
return images
|
131 |
|
132 |
+
header = "Set up APIs on HuggingFace or use free at https://app.idai.tools/"
|
133 |
+
demo = gr.Interface(fn=image_classifier, inputs=["image", "image", gr.Slider(0, 1, step=0.05, value=0.2, label="Image Strength"), "text"], outputs=["image", "image", "image"], title=header)
|
134 |
+
demo.launch(share=False)
|