Spaces:
Runtime error
Runtime error
Use GPT-4 for text generation. Disable image generation.
Browse filesFiles changed (3)
- app.py+14-12
- global_config.py+4-4
- llm_helper.py+1
114 unmodified lines115116117118119120177 unmodified lines298299300301302303304305306307308309310311312313314315114 unmodified linesst.title(APP_TEXT['app_name'])st.subheader(APP_TEXT['caption'])with st.form('my_form'):# Topic input177 unmodified lineswith st.expander('Related Web references'):st.markdown('\n\n'.join(md_text_items))# Avoid image generation. It costs time and an API call, so just limit to the text generation.with st.expander('AI-generated image on the presentation topic'):logging.info('Calling SDXL for image generation...')# img_empty.write('')# img_text.write(APP_TEXT['image_info'])image = get_ai_image_wrapper(ppt_text)if len(image) > 0:image = base64.b64decode(image)st.image(image, caption=ppt_text)st.info('Tip: Right-click on the image to save it.', icon="💡️")logging.info('Image added')def main():114 unmodified lines115116117118119120121122177 unmodified lines300301302303304305306307308309310311312313314315316317114 unmodified linesst.title(APP_TEXT['app_name'])st.subheader(APP_TEXT['caption'])st.markdown('*Running on GPT-4 at the moment. Image generation has been disabled. ''Will run as long as the community plan supports* :)')with st.form('my_form'):# Topic input177 unmodified lineswith st.expander('Related Web references'):st.markdown('\n\n'.join(md_text_items))# # Avoid image generation. It costs time and an API call, so just limit to the text generation.# with st.expander('AI-generated image on the presentation topic'):# logging.info('Calling SDXL for image generation...')# # img_empty.write('')# # img_text.write(APP_TEXT['image_info'])# image = get_ai_image_wrapper(ppt_text)## if len(image) > 0:# image = base64.b64decode(image)# st.image(image, caption=ppt_text)# st.info('Tip: Right-click on the image to save it.', icon="💡️")# logging.info('Image added')def main():
8 unmodified lines91011121314151617181920218 unmodified lines@dataclass(frozen=True)class GlobalConfig:CLARIFAI_PAT = os.environ.get('CLARIFAI_PAT', '')CLARIFAI_USER_ID = 'clarifai'CLARIFAI_APP_ID = 'ml'CLARIFAI_MODEL_ID = 'llama2-13b-alternative-4k'CLARIFAI_USER_ID_GPT = 'openai'CLARIFAI_APP_ID_GPT = 'chat-completion'CLARIFAI_MODEL_ID_GPT = 'GPT-3_5-turbo'CLARIFAI_USER_ID_SD = 'stability-ai'CLARIFAI_APP_ID_SD = 'stable-diffusion-2'8 unmodified lines91011121314151617181920218 unmodified lines@dataclass(frozen=True)class GlobalConfig:CLARIFAI_PAT = os.environ.get('CLARIFAI_PAT', '')CLARIFAI_USER_ID = 'meta'CLARIFAI_APP_ID = 'Llama-2'CLARIFAI_MODEL_ID = 'llama2-13b-chat'CLARIFAI_USER_ID_GPT = 'openai'CLARIFAI_APP_ID_GPT = 'chat-completion'CLARIFAI_MODEL_ID_GPT = 'GPT-4' # 'GPT-3_5-turbo'CLARIFAI_USER_ID_SD = 'stability-ai'CLARIFAI_APP_ID_SD = 'stable-diffusion-2'
61 unmodified lines62636465666761 unmodified linesif llm is None:llm = get_llm(use_gpt=True)slides_content = llm(template_txt, verbose=True)61 unmodified lines6263646566676861 unmodified linesif llm is None:llm = get_llm(use_gpt=True)print(llm)slides_content = llm(template_txt, verbose=True)
app.py+14-12
global_config.py+4-4
llm_helper.py+1