Corin1998 commited on
Commit
b63bdda
·
verified ·
1 Parent(s): 79f5555

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -27,7 +27,7 @@ def process_resumes(filepaths, candidate_id: str, additional_notes: str = ""):
27
  partial_records = []
28
  raw_texts = []
29
 
30
- # gr.Files(type="filepath") から渡されるのは文字列パス
31
  for path in filepaths:
32
  with open(path, "rb") as f:
33
  raw_bytes = f.read()
@@ -70,7 +70,7 @@ def process_resumes(filepaths, candidate_id: str, additional_notes: str = ""):
70
  "skills": ", ".join(merged.get("skills", [])),
71
  })
72
 
73
- # 6) 匿名化(軽量正規表現ベース)
74
  anonymized_text, anon_map = anonymize_text(merged_text)
75
  anon_pdf_bytes = render_anonymized_pdf(anonymized_text)
76
 
@@ -110,7 +110,7 @@ def process_resumes(filepaths, candidate_id: str, additional_notes: str = ""):
110
 
111
  return (
112
  json.dumps(result_json, ensure_ascii=False, indent=2),
113
- json.dumps(skills, ensure_ascii=False, indent=2), # JSONは Code で返す
114
  json.dumps(score, ensure_ascii=False, indent=2),
115
  summaries.get("300chars", ""),
116
  summaries.get("100chars", ""),
@@ -124,7 +124,7 @@ with gr.Blocks(title=APP_TITLE) as demo:
124
  gr.Markdown(f"# {APP_TITLE}\n複数ファイルを統合→OpenAIで読み込み/構造化/要約→匿名化→Datasets保存")
125
 
126
  with gr.Row():
127
- # Gradio v4 type="file" 非対応。'filepath' を使用
128
  in_files = gr.Files(
129
  label="レジュメ類 (PDF/画像/Word/テキスト) 複数可",
130
  file_count="multiple",
@@ -140,7 +140,7 @@ with gr.Blocks(title=APP_TITLE) as demo:
140
  out_json = gr.Code(label="統合出力 (JSON)")
141
 
142
  with gr.Tab("抽出スキル"):
143
- # JSONウィジェットの型推論バグを回避。Codeで安全に表示
144
  out_skills = gr.Code(label="スキル一覧 (JSON)")
145
 
146
  with gr.Tab("品質スコア"):
@@ -165,5 +165,5 @@ with gr.Blocks(title=APP_TITLE) as demo:
165
 
166
 
167
  if __name__ == "__main__":
168
- # ローカル到達不可環境対策
169
  demo.launch(share=True, server_name="0.0.0.0", server_port=7860)
 
27
  partial_records = []
28
  raw_texts = []
29
 
30
+ # gr.Files(type="filepath") からは文字列パスが渡る
31
  for path in filepaths:
32
  with open(path, "rb") as f:
33
  raw_bytes = f.read()
 
70
  "skills": ", ".join(merged.get("skills", [])),
71
  })
72
 
73
+ # 6) 匿名化
74
  anonymized_text, anon_map = anonymize_text(merged_text)
75
  anon_pdf_bytes = render_anonymized_pdf(anonymized_text)
76
 
 
110
 
111
  return (
112
  json.dumps(result_json, ensure_ascii=False, indent=2),
113
+ json.dumps(skills, ensure_ascii=False, indent=2), # JSONはCodeで安全表示
114
  json.dumps(score, ensure_ascii=False, indent=2),
115
  summaries.get("300chars", ""),
116
  summaries.get("100chars", ""),
 
124
  gr.Markdown(f"# {APP_TITLE}\n複数ファイルを統合→OpenAIで読み込み/構造化/要約→匿名化→Datasets保存")
125
 
126
  with gr.Row():
127
+ # Gradio v4: type="file" は無効。filepath を使う
128
  in_files = gr.Files(
129
  label="レジュメ類 (PDF/画像/Word/テキスト) 複数可",
130
  file_count="multiple",
 
140
  out_json = gr.Code(label="統合出力 (JSON)")
141
 
142
  with gr.Tab("抽出スキル"):
143
+ # JSONウィジェットのスキーマ推論バグ回避のため Code で出力
144
  out_skills = gr.Code(label="スキル一覧 (JSON)")
145
 
146
  with gr.Tab("品質スコア"):
 
165
 
166
 
167
  if __name__ == "__main__":
168
+ # localhost 到達不可環境でも起動できるように share=True を明示
169
  demo.launch(share=True, server_name="0.0.0.0", server_port=7860)