barunsaha commited on
Commit
7b01107
1 Parent(s): 4ae1184

Use GPT-4 for text generation. Disable image generation.

Browse files
Files changed (3) hide show
  1. app.py +14 -12
  2. global_config.py +4 -4
  3. llm_helper.py +1 -0
app.py CHANGED
@@ -115,6 +115,8 @@ def build_ui():
115
 
116
  st.title(APP_TEXT['app_name'])
117
  st.subheader(APP_TEXT['caption'])
 
 
118
 
119
  with st.form('my_form'):
120
  # Topic input
@@ -298,18 +300,18 @@ def show_bonus_stuff(ppt_headers: List[str]):
298
  with st.expander('Related Web references'):
299
  st.markdown('\n\n'.join(md_text_items))
300
 
301
- # Avoid image generation. It costs time and an API call, so just limit to the text generation.
302
- with st.expander('AI-generated image on the presentation topic'):
303
- logging.info('Calling SDXL for image generation...')
304
- # img_empty.write('')
305
- # img_text.write(APP_TEXT['image_info'])
306
- image = get_ai_image_wrapper(ppt_text)
307
-
308
- if len(image) > 0:
309
- image = base64.b64decode(image)
310
- st.image(image, caption=ppt_text)
311
- st.info('Tip: Right-click on the image to save it.', icon="💡️")
312
- logging.info('Image added')
313
 
314
 
315
  def main():
 
115
 
116
  st.title(APP_TEXT['app_name'])
117
  st.subheader(APP_TEXT['caption'])
118
+ st.markdown('*Running on GPT-4 at the moment. Image generation has been disabled. '
119
+ 'Will run as long as the community plan supports* :)')
120
 
121
  with st.form('my_form'):
122
  # Topic input
 
300
  with st.expander('Related Web references'):
301
  st.markdown('\n\n'.join(md_text_items))
302
 
303
+ # # Avoid image generation. It costs time and an API call, so just limit to the text generation.
304
+ # with st.expander('AI-generated image on the presentation topic'):
305
+ # logging.info('Calling SDXL for image generation...')
306
+ # # img_empty.write('')
307
+ # # img_text.write(APP_TEXT['image_info'])
308
+ # image = get_ai_image_wrapper(ppt_text)
309
+ #
310
+ # if len(image) > 0:
311
+ # image = base64.b64decode(image)
312
+ # st.image(image, caption=ppt_text)
313
+ # st.info('Tip: Right-click on the image to save it.', icon="💡️")
314
+ # logging.info('Image added')
315
 
316
 
317
  def main():
global_config.py CHANGED
@@ -9,13 +9,13 @@ load_dotenv()
9
  @dataclass(frozen=True)
10
  class GlobalConfig:
11
  CLARIFAI_PAT = os.environ.get('CLARIFAI_PAT', '')
12
- CLARIFAI_USER_ID = 'clarifai'
13
- CLARIFAI_APP_ID = 'ml'
14
- CLARIFAI_MODEL_ID = 'llama2-13b-alternative-4k'
15
 
16
  CLARIFAI_USER_ID_GPT = 'openai'
17
  CLARIFAI_APP_ID_GPT = 'chat-completion'
18
- CLARIFAI_MODEL_ID_GPT = 'GPT-3_5-turbo'
19
 
20
  CLARIFAI_USER_ID_SD = 'stability-ai'
21
  CLARIFAI_APP_ID_SD = 'stable-diffusion-2'
 
9
  @dataclass(frozen=True)
10
  class GlobalConfig:
11
  CLARIFAI_PAT = os.environ.get('CLARIFAI_PAT', '')
12
+ CLARIFAI_USER_ID = 'meta'
13
+ CLARIFAI_APP_ID = 'Llama-2'
14
+ CLARIFAI_MODEL_ID = 'llama2-13b-chat'
15
 
16
  CLARIFAI_USER_ID_GPT = 'openai'
17
  CLARIFAI_APP_ID_GPT = 'chat-completion'
18
+ CLARIFAI_MODEL_ID_GPT = 'GPT-4' # 'GPT-3_5-turbo'
19
 
20
  CLARIFAI_USER_ID_SD = 'stability-ai'
21
  CLARIFAI_APP_ID_SD = 'stable-diffusion-2'
llm_helper.py CHANGED
@@ -62,6 +62,7 @@ def generate_slides_content(topic: str) -> str:
62
 
63
  if llm is None:
64
  llm = get_llm(use_gpt=True)
 
65
 
66
  slides_content = llm(template_txt, verbose=True)
67
 
 
62
 
63
  if llm is None:
64
  llm = get_llm(use_gpt=True)
65
+ print(llm)
66
 
67
  slides_content = llm(template_txt, verbose=True)
68