ammaan commited on
Commit
61e269a
·
verified ·
1 Parent(s): b0034ea

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -11
main.py CHANGED
@@ -29,19 +29,11 @@ def get_youtube_transcript(video_url):
29
  text_transcript = formatter.format_transcript(transcript)
30
  return text_transcript
31
  except Exception as e:
32
- return f" {e}"
33
 
34
  def summarize_text(text):
35
- try:
36
- text = str(text)
37
- text = text.encode("utf-8")
38
-
39
- # Summarize the text
40
- summarized_text = text_summary(text)
41
-
42
- return summarized_text[0]['summary_text']
43
- except Exception as e:
44
- return f"{e}"
45
 
46
  # Get the input from the frontend
47
  @app.get("/getdata")
 
29
  text_transcript = formatter.format_transcript(transcript)
30
  return text_transcript
31
  except Exception as e:
32
+ return f"An error occurred: {e}"
33
 
34
  def summarize_text(text):
35
+ summarized_text = text_summary(text)
36
+ return summarized_text[0]['summary_text']
 
 
 
 
 
 
 
 
37
 
38
  # Get the input from the frontend
39
  @app.get("/getdata")