Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import torch
|
|
8 |
import huggingface_hub
|
9 |
|
10 |
# Replace with your actual Groq API key
|
11 |
-
api_key = "
|
12 |
client = Groq(api_key=api_key)
|
13 |
|
14 |
# Set Hugging Face API key
|
@@ -26,14 +26,14 @@ model_id1 = "dreamlike-art/dreamlike-diffusion-1.0"
|
|
26 |
model_id2 = "stabilityai/stable-diffusion-xl-base-1.0"
|
27 |
restricted_model_id = "ByteDance/SDXL-Lightning" # Model you want to access using HF_API_KEY
|
28 |
|
29 |
-
# Initialize Stable Diffusion pipeline based on device
|
30 |
-
if torch.cuda.is_available():
|
31 |
-
|
32 |
-
else:
|
33 |
-
|
34 |
|
35 |
-
# Move model to the selected device (either GPU or CPU)
|
36 |
-
pipe = pipe.to(device)
|
37 |
|
38 |
# Function to transcribe, translate, and analyze sentiment
|
39 |
def process_audio(audio_path, image_option):
|
|
|
8 |
import huggingface_hub
|
9 |
|
10 |
# Replace with your actual Groq API key
|
11 |
+
api_key = os.getenv("GROQ_API_KEY")
|
12 |
client = Groq(api_key=api_key)
|
13 |
|
14 |
# Set Hugging Face API key
|
|
|
26 |
model_id2 = "stabilityai/stable-diffusion-xl-base-1.0"
|
27 |
restricted_model_id = "ByteDance/SDXL-Lightning" # Model you want to access using HF_API_KEY
|
28 |
|
29 |
+
# # Initialize Stable Diffusion pipeline based on device
|
30 |
+
# if torch.cuda.is_available():
|
31 |
+
# pipe = StableDiffusionPipeline.from_pretrained(model_id2, torch_dtype=torch.float16)
|
32 |
+
# else:
|
33 |
+
# pipe = StableDiffusionPipeline.from_pretrained(model_id2) # Omit torch_dtype for CPU
|
34 |
|
35 |
+
# # Move model to the selected device (either GPU or CPU)
|
36 |
+
# pipe = pipe.to(device)
|
37 |
|
38 |
# Function to transcribe, translate, and analyze sentiment
|
39 |
def process_audio(audio_path, image_option):
|