saranbalan commited on
Commit
9fc2ff8
·
verified ·
1 Parent(s): 7318986

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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 = "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"
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
- 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):
 
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):