saranbalan commited on
Commit
dff67aa
·
verified ·
1 Parent(s): 4f52190

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -17,9 +17,11 @@ client = Groq(api_key=api_key)
17
 
18
  # Set device: CUDA if available, else CPU
19
  # device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
 
 
20
 
21
  model_id1 = os.getenv("API_KEY")
22
- pipe = StableDiffusionPipeline.from_pretrained(model_id1, torch_dtype=torch.float16, use_safetensors=True)
23
  pipe = pipe.to('cpu')
24
 
25
  # Updated function for text generation using the new API structure
 
17
 
18
  # Set device: CUDA if available, else CPU
19
  # device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
20
+ torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
21
+
22
 
23
  model_id1 = os.getenv("API_KEY")
24
+ pipe = StableDiffusionPipeline.from_pretrained(model_id1, torch_dtype=torch_dtype, use_safetensors=True)
25
  pipe = pipe.to('cpu')
26
 
27
  # Updated function for text generation using the new API structure