Jessiesj commited on
Commit
9c3622c
·
verified ·
1 Parent(s): 8402f96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -454,20 +454,21 @@ if user_input and style_or_opening:
454
  }"""
455
 
456
  # 生成分镜
457
- storyboard = storyboard_pipe(
458
- f"Convert to storyboard JSON: {cleaned[:800]}",
459
- max_length=1500,
460
- temperature=0.3
461
- )[0]["generated_text"]
462
-
463
- # 增强的格式修复
464
- storyboard = (
465
- storyboard.replace("'", '"')
466
- .replace("None", '""')
467
- .replace("True", "true")
468
- .replace("False", "false")
469
- )
470
- storyboard = re.search(r'\{.*\}', storyboard, re.DOTALL).group()
 
471
  parsed = json.loads(storyboard)
472
 
473
  except Exception as e:
@@ -478,7 +479,7 @@ if user_input and style_or_opening:
478
  status.update(label="Storyboard ready")
479
  st.subheader("Storyboard Script")
480
  st.json(parsed)
481
- st.caption("*Note: If using sample data, edit the JSON before proceeding*")
482
 
483
  st.subheader("🎧 Background Music")
484
  for i, scene in enumerate(parsed["scenes"]):
 
454
  }"""
455
 
456
  # 生成分镜
457
+ # storyboard = storyboard_pipe(
458
+ # f"Convert to storyboard JSON: {cleaned[:800]}",
459
+ # max_length=1500,
460
+ # temperature=0.3
461
+ # )[0]["generated_text"]
462
+
463
+ # # 增强的格式修复
464
+ # storyboard = (
465
+ # storyboard.replace("'", '"')
466
+ # .replace("None", '""')
467
+ # .replace("True", "true")
468
+ # .replace("False", "false")
469
+ # )
470
+ # storyboard = re.search(r'\{.*\}', storyboard, re.DOTALL).group()
471
+ storyboard = sample_storyboard###replace it##
472
  parsed = json.loads(storyboard)
473
 
474
  except Exception as e:
 
479
  status.update(label="Storyboard ready")
480
  st.subheader("Storyboard Script")
481
  st.json(parsed)
482
+ # st.caption("*Note: If using sample data, edit the JSON before proceeding*")
483
 
484
  st.subheader("🎧 Background Music")
485
  for i, scene in enumerate(parsed["scenes"]):