tomo2chin2 commited on
Commit
da89e24
·
verified ·
1 Parent(s): a8dbb84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -208,14 +208,14 @@ def load_system_instruction(style="standard"):
208
  指定されたスタイルのシステムインストラクションを読み込む
209
 
210
  Args:
211
- style: 使用するスタイル名 (standard, cute, resort, cool, dental)
212
 
213
  Returns:
214
  読み込まれたシステムインストラクション
215
  """
216
  try:
217
  # 有効なスタイル一覧
218
- valid_styles = ["standard", "cute", "resort", "cool", "dental"]
219
 
220
  # スタイルの検証
221
  if style not in valid_styles:
@@ -270,7 +270,7 @@ def load_system_instruction(style="standard"):
270
  logger.error(error_msg)
271
  raise ValueError(error_msg)
272
 
273
- def generate_html_from_text(text, temperature=0.3, style="standard"):
274
  """テキストからHTMLを生成する"""
275
  try:
276
  # APIキーの取得と設定
@@ -601,7 +601,7 @@ def render_fullpage_screenshot(html_code: str, extension_percentage: float = 6.0
601
  logger.error(f"Error removing temporary file {tmp_path}: {e}")
602
 
603
  # --- 並列処理を活用した新しい関数 ---
604
- def text_to_screenshot_parallel(text: str, extension_percentage: float, temperature: float = 0.3,
605
  trim_whitespace: bool = True, style: str = "standard") -> Image.Image:
606
  """テキストをGemini APIでHTMLに変換し、並列処理でスクリーンショットを生成する関数"""
607
  start_time = time.time()
@@ -931,7 +931,7 @@ with gr.Blocks(title="Full Page Screenshot (テキスト変換対応)", theme=gr
931
  with gr.Column(scale=1):
932
  # スタイル選択ドロップダウン
933
  style_dropdown = gr.Dropdown(
934
- choices=["standard", "cute", "resort", "cool", "dental"],
935
  value="standard",
936
  label="デザインスタイル",
937
  info="テキスト→HTML変換時のデザインテーマを選択します",
 
208
  指定されたスタイルのシステムインストラクションを読み込む
209
 
210
  Args:
211
+ style: 使用するスタイル名 (standard, cute, resort, cool, dental, school)
212
 
213
  Returns:
214
  読み込まれたシステムインストラクション
215
  """
216
  try:
217
  # 有効なスタイル一覧
218
+ valid_styles = ["standard", "cute", "resort", "cool", "dental", "school"]
219
 
220
  # スタイルの検証
221
  if style not in valid_styles:
 
270
  logger.error(error_msg)
271
  raise ValueError(error_msg)
272
 
273
+ def generate_html_from_text(text, temperature=0.5, style="standard"):
274
  """テキストからHTMLを生成する"""
275
  try:
276
  # APIキーの取得と設定
 
601
  logger.error(f"Error removing temporary file {tmp_path}: {e}")
602
 
603
  # --- 並列処理を活用した新しい関数 ---
604
+ def text_to_screenshot_parallel(text: str, extension_percentage: float, temperature: float = 0.5,
605
  trim_whitespace: bool = True, style: str = "standard") -> Image.Image:
606
  """テキストをGemini APIでHTMLに変換し、並列処理でスクリーンショットを生成する関数"""
607
  start_time = time.time()
 
931
  with gr.Column(scale=1):
932
  # スタイル選択ドロップダウン
933
  style_dropdown = gr.Dropdown(
934
+ choices=["standard", "cute", "resort", "cool", "dental", "school"],
935
  value="standard",
936
  label="デザインスタイル",
937
  info="テキスト→HTML変換時のデザインテーマを選択します",