Bils commited on
Commit
c909f5f
·
verified ·
1 Parent(s): 6ad641b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -22,7 +22,6 @@ st.set_page_config(
22
  layout="wide"
23
  )
24
 
25
-
26
  # ---------------------------------------------------------------------
27
  # 2) CUSTOM CSS / UI DESIGN
28
  # ---------------------------------------------------------------------
@@ -92,7 +91,8 @@ def load_llama_pipeline(model_id: str, device: str, token: str):
92
  model_id,
93
  use_auth_token=token,
94
  torch_dtype=torch.float16 if device == "auto" else torch.float32,
95
- device_map=device
 
96
  )
97
  text_gen_pipeline = pipeline(
98
  "text-generation",
@@ -174,7 +174,7 @@ if not hf_token:
174
  st.error("No HF_TOKEN found. Please set it in your environment.")
175
  st.stop()
176
 
177
- if st.button("\u270d Generate Promo Script"):
178
  if not prompt.strip():
179
  st.error("Please provide a concept first.")
180
  else:
@@ -195,7 +195,7 @@ st.markdown("---")
195
  st.subheader("🎵 Step 2: Generate Audio")
196
  audio_length = st.slider("Track Length (tokens)", 128, 1024, 512, 64)
197
 
198
- if st.button("\ud83c\udfa7 Create Audio"):
199
  if "final_script" not in st.session_state:
200
  st.error("Please generate a script first.")
201
  else:
 
22
  layout="wide"
23
  )
24
 
 
25
  # ---------------------------------------------------------------------
26
  # 2) CUSTOM CSS / UI DESIGN
27
  # ---------------------------------------------------------------------
 
91
  model_id,
92
  use_auth_token=token,
93
  torch_dtype=torch.float16 if device == "auto" else torch.float32,
94
+ device_map=device,
95
+ low_cpu_mem_usage=True
96
  )
97
  text_gen_pipeline = pipeline(
98
  "text-generation",
 
174
  st.error("No HF_TOKEN found. Please set it in your environment.")
175
  st.stop()
176
 
177
+ if st.button(" Generate Promo Script"):
178
  if not prompt.strip():
179
  st.error("Please provide a concept first.")
180
  else:
 
195
  st.subheader("🎵 Step 2: Generate Audio")
196
  audio_length = st.slider("Track Length (tokens)", 128, 1024, 512, 64)
197
 
198
+ if st.button("🎧 Create Audio"):
199
  if "final_script" not in st.session_state:
200
  st.error("Please generate a script first.")
201
  else: