Spaces:
Runtime error
Runtime error
Increase input size, use Llama 2, and add SDXL image
Browse filesFiles changed (3)
- app.py+13-1
- global_config.py+4-4
- strings.json+1-1
123277 unmodified lines2812822832842852862876 unmodified lines294295296297298299import osimport pathlibimport json5277 unmodified lines:param ppt_headers: A list of the slide headings."""# Use the presentation title and the slides headers to find relevant info onlinelogging.info('Calling Metaphor search...')ppt_text = ' '.join(ppt_headers)search_results = get_web_search_results_wrapper(ppt_text)6 unmodified linesst.markdown('\n\n'.join(md_text_items))# Avoid image generation. It costs time and an API call, so just limit to the text generation.def main():1234277 unmodified lines2822832842852862872886 unmodified lines295296297298299300301302303304305306307308309310311import base64import osimport pathlibimport json5277 unmodified lines:param ppt_headers: A list of the slide headings."""# Use the presentation title and the slide headers to find relevant info onlinelogging.info('Calling Metaphor search...')ppt_text = ' '.join(ppt_headers)search_results = get_web_search_results_wrapper(ppt_text)6 unmodified linesst.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 lines910111213141516177 unmodified lines252627282930318 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'7 unmodified lines# LLM_MODEL_TEMPERATURE: float = 0.5LLM_MODEL_MIN_OUTPUT_LENGTH: int = 50LLM_MODEL_MAX_OUTPUT_LENGTH: int = 2000LLM_MODEL_MAX_INPUT_LENGTH: int = 250METAPHOR_API_KEY = os.environ.get('METAPHOR_API_KEY', '')8 unmodified lines910111213141516177 unmodified lines252627282930318 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'7 unmodified lines# LLM_MODEL_TEMPERATURE: float = 0.5LLM_MODEL_MIN_OUTPUT_LENGTH: int = 50LLM_MODEL_MAX_OUTPUT_LENGTH: int = 2000LLM_MODEL_MAX_INPUT_LENGTH: int = 1500METAPHOR_API_KEY = os.environ.get('METAPHOR_API_KEY', '')
13 unmodified lines1415161718192013 unmodified lines"Since you have come this far, we have unlocked some more good stuff for you!"],"input_labels": ["**Describe the topic of the presentation using 10 to 250 characters. Avoid mentioning the count of slides.**"],"button_labels": ["Generate contents",13 unmodified lines1415161718192013 unmodified lines"Since you have come this far, we have unlocked some more good stuff for you!"],"input_labels": ["**Describe the topic of the presentation using 10 to 1500 characters. Avoid mentioning the count of slides.**"],"button_labels": ["Generate contents",
app.py+13-1
global_config.py+4-4
strings.json+1-1