Hyeonseo commited on
Commit
249d61a
1 Parent(s): a7740dd

Update presentation_assistant/presentation_assistant.py

Browse files
presentation_assistant/presentation_assistant.py CHANGED
@@ -75,10 +75,10 @@ def generate_text2ppt_input_prompt(input_type, input_value, input_pages):
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": True,
79
  "max_new_tokens": 200}})
80
- reply = output[0]['generated_text'][len("You are a kind helpful PPT designer. "+input_prompt):]
81
- # reply = output[0]['generated_text']
82
  print(reply)
83
  md_text = reply[4:] if reply[:3] == "---" else reply
84
  md_text_list = md_text.split('\n')
@@ -139,9 +139,9 @@ def ppt2script(token_key, input_file, input_type):
139
 
140
  output = query({"inputs": "You are a kind helpful PPT Assistant."+input_prompt,
141
  "parameters": {
142
- "return_full_text": True,
143
  "max_new_tokens": 200}})
144
- reply = output[0]['generated_text'][len("You are a kind helpful PPT Assistant."+input_prompt):]
145
- # reply = output[0]['generated_text']
146
 
147
  return reply
 
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,
79
  "max_new_tokens": 200}})
80
+ # reply = output[0]['generated_text'][len("You are a kind helpful PPT designer. "+input_prompt):]
81
+ reply = output[0]['generated_text']
82
  print(reply)
83
  md_text = reply[4:] if reply[:3] == "---" else reply
84
  md_text_list = md_text.split('\n')
 
139
 
140
  output = query({"inputs": "You are a kind helpful PPT Assistant."+input_prompt,
141
  "parameters": {
142
+ "return_full_text": False,
143
  "max_new_tokens": 200}})
144
+ # reply = output[0]['generated_text'][len("You are a kind helpful PPT Assistant."+input_prompt):]
145
+ reply = output[0]['generated_text']
146
 
147
  return reply