Hyeonseo commited on
Commit
57eefd3
1 Parent(s): b3fcf69

revised: remove chatgpt token key

Browse files
presentation_assistant/presentation_assistant.py CHANGED
@@ -1,7 +1,6 @@
1
  import os
2
  import PyPDF2
3
  from pptx import Presentation
4
- import openai
5
  import subprocess
6
  from io import BytesIO
7
  import sys
@@ -72,7 +71,7 @@ def generate_text2ppt_input_prompt(input_type, input_value, input_pages):
72
 
73
 
74
  # Function to execute text2ppt
75
- def text2ppt(token_key, input_prompt, input_theme):
76
  output = query({"inputs": "You are a kind helpful PPT designer. "+input_prompt,
77
  "parameters": {
78
  "return_full_text": False,
@@ -96,8 +95,7 @@ def text2ppt(token_key, input_prompt, input_theme):
96
  subprocess.run(["/home/user/app/pandoc-2.14.2/bin/pandoc", "/home/user/app/text2ppt_input.md", "-t", "pptx", ppt_theme, "-o", "/home/user/app/text2ppt_output.pptx"], capture_output=True)
97
 
98
 
99
- def ppt2script(token_key, input_file, input_type):
100
- openai.api_key = token_key
101
 
102
  if input_type=="PDF":
103
  with open(input_file, 'rb') as pdf_file:
 
1
  import os
2
  import PyPDF2
3
  from pptx import Presentation
 
4
  import subprocess
5
  from io import BytesIO
6
  import sys
 
71
 
72
 
73
  # Function to execute text2ppt
74
+ def text2ppt(input_prompt, input_theme):
75
  output = query({"inputs": "You are a kind helpful PPT designer. "+input_prompt,
76
  "parameters": {
77
  "return_full_text": False,
 
95
  subprocess.run(["/home/user/app/pandoc-2.14.2/bin/pandoc", "/home/user/app/text2ppt_input.md", "-t", "pptx", ppt_theme, "-o", "/home/user/app/text2ppt_output.pptx"], capture_output=True)
96
 
97
 
98
+ def ppt2script(input_file, input_type):
 
99
 
100
  if input_type=="PDF":
101
  with open(input_file, 'rb') as pdf_file: