openfree commited on
Commit
9eabde1
ยท
verified ยท
1 Parent(s): da3727a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -36,12 +36,12 @@ def transcribe_summarize_and_blog(inputs, task):
36
  summary = hf_client.summarization(text)
37
  except Exception as e:
38
  raise gr.Error(f"์š”์•ฝ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค: {e}")
39
-
40
- # ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ… ์ƒ์„ฑ ์š”์ฒญ
41
  try:
42
  blog_post = hf_client.text_generation(
43
  prompt=f"๋‹ค์Œ ๋‚ด์šฉ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ…์„ ์ž‘์„ฑํ•ด ์ฃผ์„ธ์š”:\n{text}",
44
- temperature=0.7 # `max_length` ์ธ์ž๋ฅผ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค.
45
  )
46
  except Exception as e:
47
  raise gr.Error(f"๋ธ”๋กœ๊ทธ ๊ธ€ ์ƒ์„ฑ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค: {e}")
@@ -49,9 +49,10 @@ def transcribe_summarize_and_blog(inputs, task):
49
  return {
50
  "transcribed_text": text,
51
  "summary": summary["summary_text"],
52
- "blog_post": blog_post["generated_text"]
53
  }
54
 
 
55
  css = """
56
  footer {
57
  visibility: hidden;
 
36
  summary = hf_client.summarization(text)
37
  except Exception as e:
38
  raise gr.Error(f"์š”์•ฝ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค: {e}")
39
+
40
+ # ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ… ์ƒ์„ฑ ์š”์ฒญ
41
  try:
42
  blog_post = hf_client.text_generation(
43
  prompt=f"๋‹ค์Œ ๋‚ด์šฉ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ…์„ ์ž‘์„ฑํ•ด ์ฃผ์„ธ์š”:\n{text}",
44
+ temperature=0.7
45
  )
46
  except Exception as e:
47
  raise gr.Error(f"๋ธ”๋กœ๊ทธ ๊ธ€ ์ƒ์„ฑ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค: {e}")
 
49
  return {
50
  "transcribed_text": text,
51
  "summary": summary["summary_text"],
52
+ "blog_post": blog_post # ๋”•์…”๋„ˆ๋ฆฌ๊ฐ€ ์•„๋‹Œ ๋ฌธ์ž์—ด๋กœ ๋ฐ˜ํ™˜๋˜๋ฏ€๋กœ ๋ฐ”๋กœ ์‚ฌ์šฉ
53
  }
54
 
55
+
56
  css = """
57
  footer {
58
  visibility: hidden;