georgekutty george commited on
Commit
9c4e88f
·
1 Parent(s): 472a47d
Files changed (2) hide show
  1. app.py +5 -1
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,11 +1,15 @@
1
  from diffusers import StableDiffusionPipeline
2
  import gradio as gr
3
  import torch
 
4
 
5
  from huggingface_hub import login
6
 
7
  # 3. Login to Hugging Face (replace YOUR_HF_TOKEN with your actual token)
8
- login(token="YOUR_HF_TOKEN")
 
 
 
9
 
10
  # 4. Load private model using your token
11
  model_id = "Lookingsoft-team/Text_to_Image_Diffusion"
 
1
  from diffusers import StableDiffusionPipeline
2
  import gradio as gr
3
  import torch
4
+ import os
5
 
6
  from huggingface_hub import login
7
 
8
  # 3. Login to Hugging Face (replace YOUR_HF_TOKEN with your actual token)
9
+
10
+ hf_token = os.environ.get("HF_TOKEN")
11
+
12
+ login(token=hf)
13
 
14
  # 4. Load private model using your token
15
  model_id = "Lookingsoft-team/Text_to_Image_Diffusion"
requirements.txt CHANGED
@@ -5,3 +5,4 @@ gradio
5
  scipy
6
  accelerate
7
  safetensors
 
 
5
  scipy
6
  accelerate
7
  safetensors
8
+ os